Skip to content

Instantly share code, notes, and snippets.

@leikind
Created Sep 13, 2010
Embed
What would you like to do?
# 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