Last active
October 5, 2015 19:37
-
-
Save dAnjou/2864355 to your computer and use it in GitHub Desktop.
Script to find Git repos and show their status
This file contains hidden or 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 | |
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