Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.