timshadel
1/28/2009 - 10:37 PM

Use git-symbolic-ref instead of git-branch for showing current branch on the commandline

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) $ "