Skip to content
Latchkey

Git LFS "git: lfs is not a git command" in CI

Git tried to run the LFS filter but the git-lfs binary is missing or never initialized. The checkout then leaves pointer files in place or fails outright on the smudge step.

What this error means

A clone or checkout reports git: lfs is not a git command or smudge filter lfs failed, and LFS-tracked files appear as small text pointers rather than their real content.

git
git: 'lfs' is not a git command. See 'git --help'.
error: external filter 'git-lfs filter-process' failed
fatal: <file>: smudge filter lfs failed

Common causes

git-lfs binary not installed

The runner image does not include git-lfs, so the lfs subcommand and filter are unavailable.

LFS filters not initialized

git-lfs is present but git lfs install was never run, so the smudge/clean filters are not wired into git config.

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 filters before checkout.
Terminal
sudo apt-get update && sudo apt-get install -y git-lfs
git lfs install

Enable LFS in the checkout action

  1. On GitHub Actions, set lfs: true so the action handles installation and pulling.
.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    lfs: true

How to prevent it

  • Use a runner image that ships git-lfs, run git lfs install during setup, and set lfs: true on actions/checkout for any repo that uses LFS.

Related guides

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