Created
September 6, 2013 05:28
-
-
Save ktimothy/6459878 to your computer and use it in GitHub Desktop.
show git branch in bash prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1='\u@\h: \W$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d "\n" | sed s/^/\ \(/ | sed s/$/\)/ )\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment