Skip to content

Partial Clone

Spicy — senior dev territoryGit & Version Control

ELI5 - The Vibe Check

A partial clone tells git to grab the commit history and file names, but not bother downloading the actual file contents until they're actually needed. For a massive monorepo with years of history and huge assets, that's the difference between a clone that takes ten minutes and one that takes ten seconds, fetching the heavy blobs lazily only when you check out a file that needs them.

Real Talk

Partial clone, invoked as git clone --filter=blob:none or --filter=tree:0, fetches commit and tree metadata upfront but defers downloading blob objects until they're actually needed, such as during checkout, fetching them on demand from the remote. It differs from shallow clone by preserving full commit history while filtering object content, which suits large monorepos where the history is valuable but most historical file content isn't needed all at once.

Show Me The Code

$ git clone --filter=blob:none https://github.com/org/huge-monorepo.git
Cloning into 'huge-monorepo'...
remote: Enumerating objects... (blobs fetched lazily on checkout)

When You'll Hear This

"Switch CI to a partial clone, the full history download was killing our build times." / "Partial clone keeps the log intact but skips the blobs you don't need yet."

Made with passive-aggressive love by manoga.digital. Powered by Claude.