Created
February 25, 2011 07:57
-
-
Save davidbalbert/843504 to your computer and use it in GitHub Desktop.
show branch name in your 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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/' | |
} | |
# path prompt | |
export PS1="\h:\w\$(parse_git_branch)\$ " | |
# make bash use vi mode. You are by default in "insert" mode, so you have to hit escape to get to the commands | |
set -o vi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment