Recall & Review
beginner
What is a Git submodule?
A Git submodule is a repository embedded inside another Git repository. It lets you keep a separate project inside your main project, like a folder that tracks its own history.
Click to reveal answer
beginner
Which command updates all submodules to the commit specified in the main repository?
git submodule update
Click to reveal answer
beginner
How do you initialize submodules after cloning a repository?
Use git submodule init to set up local configuration, then git submodule update to fetch the submodule content.
Click to reveal answer
intermediate
What does the command 'git submodule update --remote' do?
It fetches the latest changes from the remote repository of each submodule and updates the submodule to the latest commit on its tracked branch.
Click to reveal answer
beginner
Why should you run 'git submodule update' after pulling changes in the main repository?
Because the main repository may have updated the submodule commit pointer, so you need to update your submodules to match the new commit.
Click to reveal answer
What command initializes submodules after cloning a repository?
✗ Incorrect
git submodule init sets up the local configuration for submodules after cloning.
Which command updates submodules to the commit recorded in the main repository?
✗ Incorrect
git submodule update checks out the submodule at the commit specified by the main repo.
How do you update submodules to the latest commit on their remote branches?
✗ Incorrect
The --remote option fetches and updates submodules to the latest remote commit.
What happens if you forget to update submodules after pulling changes?
✗ Incorrect
You must update submodules manually to match the main repo's commit pointers.
Which command clones a repository and initializes submodules in one step?
✗ Incorrect
The --recurse-submodules option clones and initializes submodules automatically.
Explain the steps to properly update submodules after pulling changes in the main repository.
Think about syncing submodules with the main repo's recorded commits.
You got /3 concepts.
Describe the difference between 'git submodule update' and 'git submodule update --remote'.
One updates to a fixed commit, the other to the latest remote commit.
You got /3 concepts.