Skip to content

Instantly share code, notes, and snippets.

@itspriddle
Created June 17, 2009 17:47
Show Gist options
  • Select an option

  • Save itspriddle/131380 to your computer and use it in GitHub Desktop.

Select an option

Save itspriddle/131380 to your computer and use it in GitHub Desktop.
function parse_git_branch
{
ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
echo " (${ref#refs/heads/})"
}
PS1="[\u@\h \W\$(parse_git_branch)]\\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment