Recall & Review
beginner
What is a Git submodule?
A Git submodule is a way to include one Git repository inside another. It lets you keep a separate project inside your main project, like a folder that links to another repository.
Click to reveal answer
beginner
Which command adds a submodule to your Git repository?
The command
git submodule add <repository-url> <path> adds a submodule at the specified path inside your project.Click to reveal answer
intermediate
What file does Git update when you add a submodule?
Git updates the
.gitmodules file. This file keeps track of the submodule's URL and path inside your project.Click to reveal answer
intermediate
How do you initialize and fetch submodule content after cloning a repository with submodules?
Run
git submodule update --init --recursive. This downloads the submodule data and sets it up inside your project.Click to reveal answer
beginner
Why use submodules instead of copying code into your project?
Submodules keep the code separate and linked to its own repository. This makes updates easier and avoids mixing unrelated code directly into your project.
Click to reveal answer
Which command adds a submodule to your Git repository?
✗ Incorrect
The correct command to add a submodule is
git submodule add <repository-url> <path>.What file does Git create or update when you add a submodule?
✗ Incorrect
Git updates the
.gitmodules file to track submodule URLs and paths.After cloning a repo with submodules, which command fetches the submodule content?
✗ Incorrect
Use
git submodule update --init --recursive to initialize and fetch submodules.What is a main benefit of using Git submodules?
✗ Incorrect
Submodules keep external projects linked but separate, making management easier.
Which of these is NOT true about Git submodules?
✗ Incorrect
Submodules do NOT copy code directly; they link to another repo instead.
Explain how to add a submodule to a Git repository and what files are affected.
Think about the command and the configuration file Git updates.
You got /4 concepts.
Describe the steps to initialize and update submodules after cloning a repository.
Focus on commands to get submodules ready after cloning.
You got /3 concepts.