Skip to content

Instantly share code, notes, and snippets.

@eruffaldi
Created May 23, 2018 13:39
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 eruffaldi/b88b5867ba3173eceb4e36300263f623 to your computer and use it in GitHub Desktop.
Save eruffaldi/b88b5867ba3173eceb4e36300263f623 to your computer and use it in GitHub Desktop.
List git folders remote colored
#!/bin/bash
RESTORE='\033[0m'
RED='\033[00;31m'
GREEN='\033[00;32m'
YELLOW='\033[00;33m'
BLUE='\033[00;34m'
PURPLE='\033[00;35m'
CYAN='\033[00;36m'
LIGHTGRAY='\033[00;37m'
for x in $1/*/ ; do
q=$(GIT_DIR=$x.git git remote -v 2> /dev/null | grep fetch | awk '{print $2 }')
if [ -z "$q" ]; then
echo -e $RED $x $RESTORE
else
echo -e $GREEN $x $YELLOW $q $RESTORE
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment