Skip to content

Instantly share code, notes, and snippets.

@pankajpatel
Created February 15, 2017 18:59
Show Gist options
  • Save pankajpatel/161f859949458dcf84cc44ea0e910fd1 to your computer and use it in GitHub Desktop.
Save pankajpatel/161f859949458dcf84cc44ea0e910fd1 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Brahch Listing"
cd /c/xampp/htdocs/
RED='\033[0;31m'
BLUE='\033[1;34m'
GREEN='\033[1;32m'
NC='\033[0m' # No Color
for i in $( ls ); do
cd $i
if [ $? -eq 0 ]; then
# echo $i
output="$i"
git rev-parse --abbrev-ref HEAD &> /dev/null
if [ $? -eq 0 ]; then
# output="$output $x"
x="$(git rev-parse --abbrev-ref HEAD)"
printf "${BLUE}$output\t${GREEN}$x"
else
printf "${BLUE}$output\t${RED}--"
fi
printf "\n"
cd ..
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment