Add Git Branch Name to Shell Prompt

git

PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @
\w\[\033[0;32m\]\n$(git branch 2>/dev/null | grep "^*" | colrm 1
2)\[\033[0;32m\]??\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '

Credit: https://gist.github.com/justintv/168835

 

Leave a Reply

Your email address will not be published. Required fields are marked *