Recall & Review
beginner
What is a Git submodule?
A Git submodule is a way to include one Git repository inside another as a separate folder. It keeps the external repo at a specific commit, allowing you to track it independently.
Click to reveal answer
beginner
What is a Git subtree?
A Git subtree lets you merge another repository into a subdirectory of your repo. It copies the external repo's files and history, making it part of your main repo.
Click to reveal answer
intermediate
How do submodules handle updates from the external repository?
Submodules require manual updating by running commands to fetch and checkout new commits in the submodule folder. They do not update automatically with the main repo.
Click to reveal answer
intermediate
What is a key advantage of using Git subtrees over submodules?
Subtrees integrate the external repo fully into your main repo, so you don't need extra commands to clone or update. This makes it simpler for users who clone your repo.
Click to reveal answer
intermediate
Name one challenge when using Git submodules.
One challenge is that submodules add complexity because users must remember to initialize and update them separately, which can cause confusion or errors if forgotten.
Click to reveal answer
Which Git feature keeps an external repository as a separate folder linked to a specific commit?
✗ Incorrect
Submodules link an external repo as a separate folder at a specific commit.
Which method fully integrates the external repository's files and history into your main repository?
✗ Incorrect
Subtrees merge the external repo into your main repo, including its history.
What must you do after cloning a repository that uses submodules to get the submodule content?
✗ Incorrect
Submodules require manual initialization and update after cloning.
Which approach can cause confusion because it requires extra commands to keep external code updated?
✗ Incorrect
Submodules need manual updates, which can confuse users.
Which Git feature is simpler for users cloning the repo because it does not require extra commands to get external code?
✗ Incorrect
Subtrees include external code directly, so cloning gets everything at once.
Explain the main differences between Git submodules and Git subtrees.
Think about how each method handles external code and updates.
You got /4 concepts.
Describe a scenario where using Git submodules might be better than subtrees.
Consider control and separation of external code.
You got /4 concepts.