Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to add a submodule to your Git repository.
Git
git submodule [1] https://github.com/example/repo.git Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'clone' instead of 'add' will clone a repo but not add it as a submodule.
✗ Incorrect
The git submodule add command adds a new submodule to your repository.
2fill in blank
mediumComplete the command to initialize submodules after cloning a repository.
Git
git submodule [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add' again instead of 'init' after cloning.
✗ Incorrect
The git submodule init command initializes your local configuration file for submodules.
3fill in blank
hardFix the error in the command to update submodules recursively.
Git
git submodule update --[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--init' instead of '--recursive' will not update nested submodules.
✗ Incorrect
The --recursive flag updates all nested submodules inside submodules.
4fill in blank
hardFill both blanks to create a submodule and initialize it.
Git
git submodule [1] https://github.com/example/repo.git && git submodule [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'clone' instead of 'add' or 'update' instead of 'init'.
✗ Incorrect
First, you add the submodule, then initialize it locally.
5fill in blank
hardFill all three blanks to update submodules recursively and initialize them.
Git
git submodule [1] && git submodule [2] --[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'add' with 'update' or missing the '--recursive' flag.
✗ Incorrect
Use init to initialize them, then update --recursive to update all nested submodules.