-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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