Show current branch in Bash
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
PS1="$PS1\$(parse_git_branch)$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
O5ten commentedDec 16, 2014
Add the above to your ~/.bashrc with your favourite editor
source ~/.bashrc