Skip to content

Instantly share code, notes, and snippets.

@zanshin
Forked from dAnjou/gitted.sh
Created June 4, 2012 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zanshin/2868453 to your computer and use it in GitHub Desktop.
Save zanshin/2868453 to your computer and use it in GitHub Desktop.
Script to find Git repos and show their status
#!/bin/bash
echo
find . -type d -name ".git" -execdir bash -c '
if [ ! $(git status | grep -o nothing) ]
then
x=$(basename "$PWD")
y=$(dirname "$PWD")
echo -e "\033[1;32m${x}\033[0m (${y})" >&2
git status -s >&2
echo >&2
fi
' \; > /dev/null
@zanshin
Copy link
Author

zanshin commented Jun 4, 2012

2012-06-04: Changed escape characters (\e) to be \033. \e wasn't working for me.

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