0
0
Gitdevops~20 mins

Removing submodules in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Submodule Removal Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output after removing a submodule directory?
You run these commands in a git repository:

git rm --cached path/to/submodule
rm -rf path/to/submodule
git commit -m "Remove submodule"

What will git status show immediately after the commit?
ANo changes, clean working tree
BDeleted submodule directory shown as deleted
CSubmodule still listed in .gitmodules as modified
DUntracked files in submodule directory
Attempts:
2 left
💡 Hint
Think about what happens when you remove a submodule properly and commit.
Configuration
intermediate
1:30remaining
Which file must be edited to fully remove a submodule?
You want to completely remove a submodule from your git project. Besides removing the submodule directory and running git rm --cached, which file must you edit to remove the submodule reference?
A.gitattributes
B.gitmodules
C.gitignore
Dconfig
Attempts:
2 left
💡 Hint
This file tracks submodule paths and URLs.
Troubleshoot
advanced
2:30remaining
Why does git still show a submodule after removal?
You removed a submodule directory and ran git rm --cached and committed. But git status still shows the submodule as modified. What is the most likely cause?
AYou did not run git submodule update
BYou forgot to delete the submodule directory
CThe submodule entry remains in .gitmodules and .git/config
DThe submodule repository is corrupted
Attempts:
2 left
💡 Hint
Check all places where submodule info is stored.
🔀 Workflow
advanced
3:00remaining
Correct sequence to fully remove a git submodule
Arrange the steps in the correct order to fully remove a git submodule named libs/foo:
A2,3,1,4
B1,2,3,4
C1,3,2,4
D2,1,3,4
Attempts:
2 left
💡 Hint
Think about removing from index before deleting files and updating config.
Best Practice
expert
3:00remaining
What is the safest way to remove a submodule to avoid repository corruption?
Which practice helps avoid repository corruption when removing a git submodule?
ARun git rm --cached, remove submodule entry from .gitmodules, delete directory, then commit
BRemove submodule directory manually, then run git rm --cached
CDelete submodule directory and commit directly without git rm
DOnly edit .gitmodules and commit, leaving directory intact
Attempts:
2 left
💡 Hint
Follow git's recommended removal steps carefully.