Git Advanced Cheat Sheet/Initialize and update submodules recursively

Populate nested submodules after clone or after config changes.

Section: Specialized Tools

Initialize and update submodules recursively

bash
bash
git submodule update --init --recursive
Explanation

Common recovery and onboarding command when a repository uses submodules and nested dependencies.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Specialized Tools
Cherry-pick a range without committing
Apply commit changes into the index and working tree first.
OpenIn sheetbashsame section
Attach a note to a commit
Add metadata to a commit without rewriting it.
OpenIn sheetbashsame section
Compare two versions of a branch series
Review how a patch series changed across rebases.
OpenIn sheetbashsame section
Interactive rebase last 5 commits
Open the last 5 commits in the interactive rebase todo list.
OpenIn sheetbash1 tag match
Show reflog with local timestamps
Inspect branch and HEAD movements with readable times.
OpenIn sheetbash1 tag match
Create an additional worktree for a branch
Check out another branch in a separate directory without cloning again.
OpenIn sheetbash1 tag match