Git: Recursively check submodules for diffs

Git is pretty good to work with, but when it comes to merging submodules, sometimes the project dies in the ass because someone (ie. me) forgot to commit a submodule.

kermit miffy
An example of the project dying in the ass.

To check for nested differences, use the following command:

git submodule foreach --recursive git diff --name-status

It'll go through each submodule it finds and check for a diff, spitting out the name of the files that have changed.

Entering 'submoduleA'
M       models.py
Entering 'submoduleB'
M       models.py
Entering 'submoduleC'
Entering 'submoduleD'

Remove the "--name-status" flag to show the actual diffs.

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