Recall & Review
beginner
What is a shallow clone in Git?
A shallow clone is a copy of a Git repository that contains only the latest commits up to a specified depth, not the full history. It saves time and space.
Click to reveal answer
beginner
How do you create a shallow clone with a depth of 5 commits?
Use the command:
git clone --depth 5 <repository_url>. This clones only the last 5 commits.Click to reveal answer
beginner
Why would you use a shallow clone?
To save time and disk space when you only need recent history, such as for quick builds or testing, not full project history.
Click to reveal answer
intermediate
Can you fetch more history after a shallow clone?
Yes, you can deepen the clone later using
git fetch --deepen <number> or fetch the full history with git fetch --unshallow.Click to reveal answer
beginner
What is the difference between a shallow clone and a full clone?
A full clone downloads the entire commit history, while a shallow clone downloads only a limited number of recent commits.
Click to reveal answer
Which command creates a shallow clone with a depth of 3 commits?
✗ Incorrect
The correct syntax to create a shallow clone with limited commits is using --depth followed by the number.
What is a main benefit of using shallow clones?
✗ Incorrect
Shallow clones reduce the amount of data downloaded, making cloning faster and saving disk space.
How can you get more commits after a shallow clone?
✗ Incorrect
You can deepen the history of a shallow clone by fetching more commits with git fetch --deepen.
Which of these is NOT true about shallow clones?
✗ Incorrect
Shallow clones do NOT include the full commit history; they only include recent commits.
What happens if you run
git fetch --unshallow?✗ Incorrect
The command downloads the full commit history, making the shallow clone a full clone.
Explain what a shallow clone is and why it might be useful.
Think about cloning only recent changes instead of everything.
You got /3 concepts.
Describe how to create a shallow clone and how to get more history later.
Start shallow, then deepen or unshallow as needed.
You got /3 concepts.