Execute a shell command across all submodules.
Section: Submodule Workflows
Run a command in every submodule
bash
bash
git submodule foreach --recursive 'git status --short'Explanation
Great for auditing or applying common operations across many 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.
Clone including submodules
Clone a repository and initialize its submodules immediately.
Update submodules to their tracked remote branches
Fetch and move submodules according to configured tracking branches.
Start bisect with good and bad revisions
Initialize bisect and mark boundaries.