Created
October 26, 2013 13:59
-
-
Save foundry/7169773 to your computer and use it in GitHub Desktop.
bash_profile additions to show your current git branch
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
:parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
PS1="\[\033[0;31m\]\h:\w\n\u\$(parse_git_branch)>\[\033[0m\] " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your PS1 line will differ. You need to insert
$(parse_git_branch)
before the prompt.