Skip to content

Instantly share code, notes, and snippets.

@jasonferrier
Last active August 29, 2015 14:18
Show Gist options
  • Save jasonferrier/91f37a0f22b30ab6d0e2 to your computer and use it in GitHub Desktop.
Save jasonferrier/91f37a0f22b30ab6d0e2 to your computer and use it in GitHub Desktop.
This bash script will inform you any changes in subdirectories that are git repositories
#!/bin/bash
# This bash script will inform you any changes in subdirectories that are git repositories
# todo: trim "/.git" from the output of line 13
for dir in ~/Projects/*/.git
do (
cd $dir/..
if [[ -n $(git status -s) ]]; then
#echo "there are files"
echo -e "\033[0;35m$dir \033[0;33m[$(git rev-parse --abbrev-ref HEAD)]\033[0m"
echo -e "\033[1;32m\tCHANGES\033[0m"
#git status -s
echo ""
fi
)
done
@jasonferrier
Copy link
Author

wtfbbqlol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment