Making a Big Repo Feel Small

Sparse checkout as the everyday way to work in a monorepo.

Making a Big Repo Feel Small

Walking into a monorepo for the first time can feel like arriving in a city without a map. Streets go on forever, blocks repeat themselves, and you only need a few addresses. Sparse checkout is the tool that stops you trying to live in every neighbourhood at once.

Why sparse checkout exists

Large repos are no longer unusual. They are the normal state of modern engineering. Companies that consolidate code do it for good reason: faster refactors, one source of truth, easier inner-sourcing, and predictable release trains. But the trade-off is obvious: no individual developer can or should carry the whole weight of the codebase.

Without sparse checkout, cloning a repo with dozens of apps and hundreds of libraries takes hours and fills disks. IDEs groan under the indexing load. New starters lose half a day before they even compile “Hello World.” Sparse checkout trims the working copy to only what is needed. It acknowledges that developers operate in their own neighbourhoods while still belonging to the same city.

This is not exotic. It is how the best in the industry work. Google’s Android teams rely on repo to pull just the projects they need. Microsoft created GVFS (now VFS for Git) so Windows engineers could work productively without carrying the whole operating system tree. Meta went as far as building Sapling, their own Git-compatible client, because at their scale filtering is the only way forward. Git itself absorbed those lessons: by version 2.37, sparse checkout in cone mode is the default. What was once custom infrastructure is now just Git.

How it works in modern Git

Sparse checkout tells Git which directories to materialise in your working copy. The rest stay invisible until you ask for them. History is unchanged; you are simply choosing what to see day to day.

For Git 2.37 and later, cone mode is the only mode you need. It works directory by directory, which is what most developers want.

Start light:

git clone --filter=blob:none --no-checkout <repo-url>
cd <repo>
git sparse-checkout init --cone
git sparse-checkout set <directory>
git checkout main

Expand your world later:

git sparse-checkout add <directory> <directory> <directory>

Rejoin the full city:

git sparse-checkout disable

A new developer can be productive in minutes instead of hours.

What it is not

Sparse checkout is not a security boundary. The hidden directories are still present in history. It is not a performance cure-all either; if your repo has tangled dependencies, hiding directories will not untangle them. It is a convenience tool to keep daily work lighter.

The cultural side

The bigger shift is in how developers think. The old mental model was: each team has its own repo. The new one is: everyone shares the same repo, but uses sparse checkout to focus on their part of it. Work still flows through the same trunk, release trains still run on time, but individuals stay in their neighbourhood.

The point is not to see everything. The point is to trust the whole city is there, even if you only walk a few blocks today.