Skip to content
Latchkey

Git LFS "git-lfs: command not found" from filter-process in CI

git invoked the LFS filter but the git-lfs executable is not on the runner PATH. Without the binary, the smudge/clean filters cannot run and checkout of LFS files fails.

What this error means

checkout fails with "git: 'lfs' is not a git command" or "git-lfs: command not found", often as "error: external filter 'git-lfs filter-process' failed".

git-lfs
git: 'lfs' is not a git command. See 'git --help'.
error: external filter 'git-lfs filter-process' failed
fatal: assets/model.bin: smudge filter lfs failed

Common causes

git-lfs is not installed on the runner image

A slim or self-hosted image ships git but not the separate git-lfs package, so the filter command does not exist.

git-lfs is installed but not initialized

Even when the binary exists, git lfs install may not have registered the filters for the user running the job.

How to fix it

Install and initialize git-lfs

  1. Install the git-lfs package on the runner.
  2. Run git lfs install to register the smudge/clean filters.
  3. Re-run the checkout so the filter resolves.
Terminal
sudo apt-get update && sudo apt-get install -y git-lfs
git lfs install

Use a runner image that bundles git-lfs

GitHub-hosted runners include git-lfs by default; for self-hosted or container jobs, bake it into the image so no per-job install is needed.

How to prevent it

  • Include git-lfs in self-hosted and container runner images.
  • Run git lfs install once during image setup.
  • Pin a git-lfs version so behavior is consistent across runners.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →