Skip to content

Instantly share code, notes, and snippets.

@timshadel
Forked from tekkub/.bashrc
Created January 28, 2009 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timshadel/54227 to your computer and use it in GitHub Desktop.
Save timshadel/54227 to your computer and use it in GitHub Desktop.
Use git-symbolic-ref instead of git-branch for showing current branch on the commandline
parse_git_branch() {
git symbolic-ref HEAD 2> /dev/null | cut -d/ -f3- | sed -e 's/\(.*\)/ (\1)/'
}
PS1="\w\$(parse_git_branch) $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment