Skip to content

Instantly share code, notes, and snippets.

@leikind
Created September 13, 2010 08:19
Show Gist options
  • Save leikind/576977 to your computer and use it in GitHub Desktop.
Save leikind/576977 to your computer and use it in GitHub Desktop.
# export PS1="\u:\w$ "
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
# git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
# no highlight
# export PS1="\u:\w \$(parse_git_branch)$ "
# git branch in bold
# export PS1="\u:\w \033[1;34m\]\$(parse_git_branch)\033[0m\]$ "
export PS1="\u:\w\033[34m\]\$(parse_git_branch)\033[0m\]$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment