Created
March 27, 2013 02:44
-
-
Save peteburtis/5251160 to your computer and use it in GitHub Desktop.
I take credit for less than 10% of this. Sadly I've lost the source.
This file contains 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
#add git branch to prompt; paste at the end of your .bash_profile | |
function parse_git_branch_and_add_brackets { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\[\1\]/' | |
} | |
PS1="\h:\W\[\033[0;31m\]\$(parse_git_branch_and_add_brackets)\[\033[0m\] \u\$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment