Skip to content

Instantly share code, notes, and snippets.

@jzellman
Created June 18, 2010 15:05
Show Gist options
  • Save jzellman/443748 to your computer and use it in GitHub Desktop.
Save jzellman/443748 to your computer and use it in GitHub Desktop.
function current_branch(){
BR=$(git symbolic-ref HEAD 2>/dev/null | awk -F/ '{ print "<" $3 ">" } ') || { echo "$@" ; exit ; }
echo " $BR"
}
export PS1='\[\e[32;1m\]\u@\h \[\e[34;1m\]\w\[\e[36;1m\]$(current_branch)\[\e[0;30m\]\[\e[0m\]$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment