Skip to content

Instantly share code, notes, and snippets.

@genghisjahn
Created June 12, 2014 03:41
Show Gist options
  • Save genghisjahn/cbc6caf4b47983510903 to your computer and use it in GitHub Desktop.
Save genghisjahn/cbc6caf4b47983510903 to your computer and use it in GitHub Desktop.
Colorful Informative Github Bash Prompt
export PS1='$(git branch &>/dev/null; if [ $? -eq 0 ]; then \
echo "\[\e[0;32m\][GIT: \[\e[0;31m\]$(basename `pwd`); \[\e[0;33m\]$(git branch | grep ^*|sed s/\*\ //) \
$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; if [ "$?" -eq "0" ]; then \
echo "\[\e[0;32m\]clean"; else \
echo "\[\e[0;31m\]dirty"; fi)\[\e[0;32m\]] \$ "; else \
echo "\[\e[0;31m\][\w]\[\e[m\] \$ "; fi) \[\e[0m\]'
@blorto
Copy link

blorto commented Nov 22, 2016

awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment