Find uncommitted changes: git submodule -q foreach git status --short. If there is any conclusion - commit block.
Search untested changes: git submodule -q foreach git branch --verbose | grep "ahead\|behind".
Check the detached head: git submodule -q foreach git rev-parse --symbolic-full-name HEAD. If there is at least one "HEAD" in the output-block command.
source
share