Clone a repository and initialize its submodules immediately.
Section: Submodule Workflows
Clone including submodules
bash
bash
git clone --recurse-submodules <repo_url>Explanation
Saves an extra initialization step after clone for repositories that depend on submodules.
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 Submodule Workflows
Show submodule status
Inspect recorded commit pointers and checkout state.
Update submodules to their tracked remote branches
Fetch and move submodules according to configured tracking branches.
Run a command in every submodule
Execute a shell command across all submodules.
Start bisect with good and bad revisions
Initialize bisect and mark boundaries.