Skip to content

Instantly share code, notes, and snippets.

@mkottman
Created November 9, 2010 23:13
Show Gist options
  • Save mkottman/670020 to your computer and use it in GitHub Desktop.
Save mkottman/670020 to your computer and use it in GitHub Desktop.
# ...
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo -e " \e[0;33m"\(${ref#refs/heads/}\)
}
if [ "$color_prompt" = yes ]; then
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\$(parse_git_branch)\[\033[00m\]\$ "
else
PS1='\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment