Skip to content
Latchkey

Git LFS ".gitattributes filter=lfs" not applied in CI

Files that should route through LFS are stored as raw content because the filter=lfs attribute is not in effect. The .gitattributes may be missing, the pattern may not match, or LFS filters are not registered.

What this error means

git check-attr filter -- path shows no lfs filter, or committed files that should be pointers contain raw bytes despite an intended track rule.

git-lfs
$ git check-attr filter -- assets/model.bin
assets/model.bin: filter: unspecified
# expected: filter: lfs

Common causes

The .gitattributes rule is missing or mismatched

No committed rule matches the path, or the pattern is scoped to a subdirectory that does not cover the file, so filter=lfs never applies.

LFS filters are not registered on the runner

Without git lfs install, the clean/smudge filters are not wired up, so even a correct attribute does nothing.

How to fix it

Add the track rule and initialize LFS

  1. Run git lfs track for the pattern so a correct .gitattributes line is added.
  2. Commit .gitattributes.
  3. Ensure git lfs install has registered the filters on the runner.
Terminal
git lfs install
git lfs track "*.bin"
git add .gitattributes
git check-attr filter -- assets/model.bin

Correct the pattern scope

Make the track pattern broad enough to match the file, or place a .gitattributes in the right directory so the rule applies.

How to prevent it

  • Commit .gitattributes with correct filter=lfs patterns.
  • Run git lfs install during runner setup.
  • Verify with git check-attr filter in CI for critical paths.

Related guides

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