Skip to content

Instantly share code, notes, and snippets.

@maikelwever
Created March 7, 2012 17:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maikelwever/1994416 to your computer and use it in GitHub Desktop.
Save maikelwever/1994416 to your computer and use it in GitHub Desktop.
bashrc, git branch
# Put your fun stuff here.
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}") "
}
export PS1="\t \[\033[01;32m\]\u\[\033[01;35m\]@\[\033[01;33m\]\h\[\033[01;35m\] \w \[\033[00m\]\$(parse_git_branch)\[\033[01;35m\]\$\[\033[00m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment