Git "filtering not recognized by server" - Partial Clone Fails
A partial clone with --filter=blob:none asks the server to omit object data and fetch it lazily. If the remote does not advertise the partial-clone capability, the filter is ignored or a later command fails fetching a blob on demand.
What this error means
A git clone --filter=blob:none warns that filtering is not recognized, or a later operation fails trying to lazily fetch a missing object. It happens against servers or mirrors that have partial clone disabled.
warning: filtering not recognized by server, ignoring
# or, on lazy fetch:
fatal: missing blob object 'a1b2c3...'
fatal: unable to read tree (a1b2c3...)Diagnose it: depth, refs, or credentials?
CI checkouts are shallow and detached by default, which breaks anything that needs history or a branch name. Before treating it as a credential problem, confirm what the runner actually fetched.
- run: |
git rev-parse --is-shallow-repository
git rev-parse --abbrev-ref HEAD # prints HEAD when detached
git log --oneline -3
git remote -v
git for-each-ref --format="%(refname)" | headCommon causes
The server does not support partial clone
Partial clone needs the filter capability on the remote. Older Git servers, some mirrors, and certain hosting tiers do not advertise it, so the --filter request is silently ignored.
Lazy fetch cannot reach the promisor remote
A partial clone defers downloading blobs until needed. If the runner later goes offline from the promisor remote, the on-demand fetch of a missing object fails.
How to fix it
Fall back to a shallow clone
When the server lacks partial-clone support, a shallow clone gives a similar size reduction without needing the filter capability.
git clone --depth 1 https://github.com/org/repo.git
# instead of: git clone --filter=blob:none ...Materialize the objects you need
If you must use partial clone, backfill the blobs you will reference so no lazy fetch happens mid-job.
git clone --filter=blob:none https://github.com/org/repo.git
cd repo
git fetch origin --refetch # or: git rev-list --all | git cat-file --batch-checkThe checkout options that fix most of this
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history: diffs, tags, git describe
submodules: recursive # submodules are NOT fetched by default
persist-credentials: false # if a later step pushes with its own tokenHow to prevent it
- Verify the remote advertises the
filtercapability before using--filter. - Prefer shallow clones for simple CI size reduction.
- Keep the promisor remote reachable for the whole job when using partial clone.