Git LFS ".gitattributes filter=lfs" not applied in CI
By Kaveh Alemi·Latchkey
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.
Make the track pattern broad enough to match the file, or place a .gitattributes in the right directory so the rule applies.
Using this in CI
CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.
.github/workflows/ci.yml
- uses:actions/checkout@v4with:fetch-depth:0 # history, tags, and git describe all need this- run:|git rev-parse --is-shallow-repository # expect falsegit rev-parse --abbrev-ref HEAD # prints HEAD when detached
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.
Frequently asked questions
What causes Git LFS ".gitattributes filter=lfs" not applied in CI?
There are 2 common causes: the .gitattributes rule is missing or mismatched and lfs filters are not registered on the runner. 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.
How do I fix Git LFS ".gitattributes filter=lfs" not applied in CI?
There are 2 fixes depending on which cause you have: add the track rule and initialize lfs and correct the pattern scope. Work through them in order, since the first is the most common.
What does Git LFS ".gitattributes filter=lfs" not applied in CI actually mean?
git check-attr filter -- path shows no lfs filter, or committed files that should be pointers contain raw bytes despite an intended track rule.
How do I stop Git LFS ".gitattributes filter=lfs" not applied in CI happening again?
Commit .gitattributes with correct filter=lfs patterns. The prevention section lists 3 changes that keep it from recurring.