Checking status of submodules in main repository with this command:
git submodule status
produces output (without clear information about branches):
491e03096e2234dab9a9533da714fb6eff5dcaa7 vendor/submodule1 (v1.51.0-560-g491e030)
8bccab48338219e73c3118ad71c8c98fbd32a4be vendor/submodule2 (v1.32.0-516-g8bccab4)
Is it possible to check current branches on submodules without:
cd vendor/submodule1
git status
cd ../submodule2
git status
?
This command don't work:
git submodule status -b
You can run git submodule status --recursive
.
It gives
Answer was hidden in git submodule foreach
:
git submodule foreach 'git status'
You can always make it simpler by assign this to alias:
git config --global alias.sb "submodule foreach \"git status\""
Now git sb
give you nice information about your branches in submodules:
Entering 'vendor/submodule1'
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Entering 'vendor/submodule2'
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With