Git submodule status - how to show current branches in submodules -


checking status of submodules in main repository command:

git submodule status 

produces output (without clear information branches):

491e03096e2234dab9a9533da714fb6eff5dcaa7 vendor/submodule1 (v1.51.0-560-g491e030) 8bccab48338219e73c3118ad71c8c98fbd32a4be vendor/submodule2 (v1.32.0-516-g8bccab4) 

is possible check current branches on submodules without:

cd vendor/submodule1 git status cd ../submodule2 git status 

?

this command don't work:

git submodule status -b 

answer hidden in git submodule foreach:

git submodule foreach 'git status' 

you can make simpler assign alias:

git config --global alias.sb "submodule foreach \"git status\"" 

now git sb give nice information branches in submodules:

entering 'vendor/submodule1' on branch master branch up-to-date 'origin/master'. nothing commit, working directory clean entering 'vendor/submodule2' on branch master branch up-to-date 'origin/master'. nothing commit, working directory clean 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -