Created
August 8, 2012 21:27
-
-
Save thegrubbsian/3298926 to your computer and use it in GitHub Desktop.
Branch Name in Bash Prompt
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 --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ →\ \1/' | |
} | |
export PS1='\u\[\e[1;37m\]@\[\e[1;32m\]\h\[\e[1;37m\]:\[\e[1;31m\]\W\[\e[1;33m\]$(parse_git_branch)\[\e[0;39m\]> ' | |
export PROMPT_COMMAND='echo -ne "\033]0;${PWD}\007"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment