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