0
0
Gitdevops~10 mins

Adding a submodule in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to add a submodule to your Git repository.

Git
git [1] https://github.com/example/repo.git path/to/submodule
Drag options to blanks, or click blank then click option'
Aclone
Bsubmodule add
Cinit
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git clone' instead of 'git submodule add'.
Using 'git init' which initializes a repository, not adding submodules.
2fill in blank
medium

Complete the command to initialize submodules after cloning a repository.

Git
git [1]
Drag options to blanks, or click blank then click option'
Asubmodule update --init
Bclone --recurse-submodules
Cpull
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git pull' which updates the main repo but not submodules.
Using 'git clone --recurse-submodules' after cloning instead of during clone.
3fill in blank
hard

Fix the error in the command to update submodules recursively.

Git
git submodule update --[1]
Drag options to blanks, or click blank then click option'
Arecurse-submodules
Brecursive
Cinit
Dfetch
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--recursive' which is not a valid git submodule flag.
Using '--init' which only initializes but does not update recursively.
4fill in blank
hard

Fill both blanks to create a submodule and initialize it.

Git
git [1] https://github.com/example/repo.git path/to/submodule && git submodule [2]
Drag options to blanks, or click blank then click option'
Asubmodule add
Bclone
Cupdate --init
Dinit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git clone' instead of 'git submodule add' to add submodules.
Using 'git submodule init' alone without update.
5fill in blank
hard

Fill all three blanks to update submodules recursively and initialize them.

Git
git submodule [3] && git submodule [1] --[2]
Drag options to blanks, or click blank then click option'
Aupdate
Brecurse-submodules
Cinit
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git submodule status' instead of 'init' to initialize.
Omitting the '--recurse-submodules' flag.