Skip to content
The Git Crypt

/static/cripta/en/ossada/sparse-checkout/

Menu

GIT-019 · Workshop

git sparse-checkout

Brings to the bench only the corner of the repository that matters.

In a monorepo of thousands of folders, the working tree doesn't need to carry them all. sparse-checkout set takes the list of the ones that matter and materializes only those — history stays complete; it is the workshop floor that gets lean.

In the default (cone) mode, the list is whole directories, which keeps the command fast even in huge trees. Together with clone --filter=blob:none, it is the official recipe for working on a slice of a monorepo without downloading the rest.

$ git sparse-checkout set templates static/herbario
$ ls
go.mod  main.go  static  templates
Of the whole repository, only the corner in use on the bench.