Skip to content

Partial Clone

In one line

A partial clone downloads the repo's structure but omits some file contents (blobs), fetching them on demand.

In simple words

A partial clone (--filter) downloads a repository's commits, trees, and tags, but omits some file contents (blobs) based on a filter. When you later checkout or diff a file whose content is missing, Git fetches just that blob on demand. This dramatically reduces initial clone time and disk usage for large repos.

The most common filter is --filter=blob:none, which omits all file contents — you get the full history structure but no file bodies until you need them. --filter=tree:0 omits even tree objects for a more aggressive partial clone. The server must support the feature (GitHub, GitLab do).

Partial clone pairs with sparse checkout: clone without blobs, then materialize only the directories you need. This is the modern way to work with huge monorepos — you pay only for what you actually read. The trade-off is a small latency on first access to each file, as its blob is fetched.

Example

bash
# Clone without any file contents (blobs)
git clone --filter=blob:none https://github.com/org/huge-repo.git
cd huge-repo

# The history is complete, but file contents are fetched on demand
git log --oneline        # works — no blobs needed
cat README.md            # triggers a fetch of README.md's blob

# Combine with sparse checkout for maximum efficiency
git sparse-checkout init --cone
git sparse-checkout set packages/web

--filter=blob:none skips all file contents at clone time. Reading a file triggers an on-demand fetch of just that blob. Combined with sparse checkout, you only download what you use.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary