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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -