Last active
August 29, 2015 14:03
-
-
Save stefansundin/4dbd0c4cfb75ff44ff14 to your computer and use it in GitHub Desktop.
Execute `git status` recursively.
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 | |
# Executes `git status` in any git subdirectories you may have in your working directory. | |
# Install in a directory that's in your PATH, e.g. /usr/local/bin | |
# cd /usr/local/bin | |
# wget https://gist.githubusercontent.com/stefansundin/4dbd0c4cfb75ff44ff14/raw/git-status-rec | |
# chmod +x git-status-rec | |
# Then go to your project directory and type: | |
# git status-rec | |
for F in *; do | |
[[ ! -d "$F" ]] && continue | |
STATUS=`git -C "$F" status -s $* 2> /dev/null` | |
if [[ -n "$STATUS" ]]; then | |
echo "$F "$'\e[34m'"[`git -C "$F" rev-parse --abbrev-ref HEAD`]" | |
git -C "$F" status -s $* | |
echo | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment