Skip to content

Instantly share code, notes, and snippets.

@dAnjou
Last active October 5, 2015 19:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dAnjou/2864355 to your computer and use it in GitHub Desktop.
Save dAnjou/2864355 to your computer and use it in GitHub Desktop.
Script to find Git repos and show their status
#!/bin/bash
find "$@" -type d -name ".git" -execdir bash -c '
if [ ! $(git status | grep -o nothing) ]
then
x=$(basename "$PWD")
y=$(dirname "$PWD")
origin_url=$(git config --get remote.origin.url)
echo -e "\e[1;32m${x}\e[0m (${y}) ${origin_url}" >&2
git status -s >&2
fi
' \; > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment