What is a sparse checkout and how does it differ from a partial clone?
AdvancedConceptCommits, branches and tags
Answer
A partial clone (--filter=blob:none) limits which objects are downloaded; the rest are fetched lazily from the remote. Sparse checkout limits which paths are materialised in the working tree. They are used together for monorepos, and cone mode is the fast, directory-based pattern set.
git clone --filter=blob:none --sparse https://github.com/org/mono.git
cd mono && git sparse-checkout set services/payments libs/common
More on Commits, branches and tags
How do you write a good commit message?BeginnerWhat is the difference between `git add .`, `git add -A` and `git add -u`?BeginnerHow do you commit only part of the changes in a file?BeginnerHow do you change the last commit message or add a forgotten file?BeginnerWhat is the difference between `git switch`, `git restore` and `git checkout`?BeginnerWhat is the difference between lightweight and annotated tags?Beginner