The filter language
Partial clone filters are specified by short DSL strings. Each filter excludes objects matching the spec from the transfer; missing objects are fetched on demand from the promisor remote.
Common filters
blob:none— omit all blobs.blob:limit=<n>[kmg]— omit blobs larger than the threshold.tree:<depth>— omit trees deeper than depth (0 means no trees, history-only).sparse:oid=<blob>— use a sparse-checkout spec stored as a blob.object:type=tag— exclude objects of a type (Git 2.36+).combine:F1+F2+...— combine multiple filters with URL-encoding.
Examples
git clone --filter=blob:none url big-no-blobs
git clone --filter=blob:limit=10m url big-small-blobs
git clone --filter=tree:0 --no-checkout url history-only
git clone --filter=combine:blob:none+tree:0 url metadata-only
Choosing a filter
| Use case | Filter |
|---|---|
| Daily development on a subset | blob:none + sparse-checkout |
| CI for a specific app | blob:none + sparse-checkout cone |
| History analysis only | tree:0 |
| Large media files separate | blob:limit=10m |
| Read-only release deploy | blob:none + checkout one tag |
Sparse filter
Pre-stage a sparse spec in the repo, then clone with it:
blob_oid=$(git hash-object .sparse)
git clone --filter=sparse:oid=$blob_oid url
Useful when many users share the same cone definition.
Combining
Combine filters by URL-encoding plus signs:
git clone --filter=combine:blob%3Anone+tree%3A0 url
Each filter applies independently; the union of excluded objects is omitted.
Verifying
git config --get remote.origin.partialclonefilter
git rev-list --missing=print HEAD | wc -l
du -sh .git/objects
Common mistakes
Using tree:0 for active development — every checkout fetches trees on demand, slowly. Forgetting that blob:limit is per blob, not aggregate. Combining filters with raw + instead of URL encoding fails parsing.
Server requirements
Server must enable uploadpack.allowFilter and the specific filter; some hosts restrict tree:0 due to its CPU cost. GitHub, GitLab, Gitea, Bitbucket, Forgejo all support standard filters.
Related
See "Partial clone: promise and promisor remotes" and "Sparse checkout for monorepos".