Last active
March 29, 2019 12:25
-
-
Save thiagomarinho/479f4585f931e6c2c4819d84db47bdd3 to your computer and use it in GitHub Desktop.
Git status for many repositories in one directory + git diff if there are changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# XXX add parameter to accept a path to show status | |
for d in */ ; do | |
echo; | |
echo '-------------------------------' | |
echo "Git status $d" | |
cd $d | |
if [ -z "$(git status --porcelain)" ]; then | |
echo; echo 'Repository is clean!' | |
else | |
git --no-pager diff | |
fi | |
cd .. | |
echo; | |
echo '-------------------------------' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment