Git: Do a "git status" on each submodule using foreach

Strangely enough, its fine doing a git branch on each submodule using "git submodule foreach git branch".

However, if you try "git status" it wont be happy. It'll spit out this error after the first submodule.

Stopping at 'firstmodule'; script returned non-zero status.

Instead, use:

git submodule foreach "git status || true"

This will go through each submodule and perform a status, without any errors.

Now go forth and celebrate your success!

wvrex2

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog