0
0
Gitdevops~5 mins

Sparse checkout for partial repos in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is sparse checkout in Git?
Sparse checkout allows you to check out only a part of a Git repository instead of the whole repo. This saves space and time when you only need specific folders or files.
Click to reveal answer
beginner
Which Git command enables sparse checkout mode?
The command git sparse-checkout init enables sparse checkout mode in your local repository.
Click to reveal answer
beginner
How do you specify which folders or files to include in a sparse checkout?
You use git sparse-checkout set <folder1> <folder2> to list the folders or files you want to check out.
Click to reveal answer
beginner
What is the benefit of using sparse checkout in large repositories?
Sparse checkout reduces disk space usage and speeds up operations by only downloading and checking out the parts of the repo you need.
Click to reveal answer
intermediate
What is the sequence of commands to start sparse checkout on an existing Git repo?
1. git sparse-checkout init<br>2. git sparse-checkout set <paths><br>3. git checkout <branch> (if needed to update working tree)
Click to reveal answer
Which command initializes sparse checkout in Git?
Agit clone --sparse
Bgit checkout sparse
Cgit sparse-checkout init
Dgit config sparseCheckout true
How do you specify folders to include in sparse checkout?
Agit sparse-checkout set <folders>
Bgit add <folders>
Cgit checkout <folders>
Dgit clone --filter=<folders>
What is a main advantage of sparse checkout?
AFaster cloning of entire repo
BChecking out only needed parts of repo
CAutomatically merging branches
DEncrypting repository data
Which file does Git use internally to track sparse checkout paths?
A.git/info/sparse-checkout
B.gitignore
C.gitattributes
D.git/config
If you want to add more folders to sparse checkout later, what do you do?
AEdit .gitignore file
BRun git add <new folders>
CRun git clone again
DRun git sparse-checkout set with all desired folders again
Explain how to set up sparse checkout in an existing Git repository step-by-step.
Think about enabling sparse mode, choosing folders, and updating working tree.
You got /3 concepts.
    Describe the benefits of using sparse checkout when working with large repositories.
    Consider what happens when you don't need the whole repo.
    You got /3 concepts.