Created
May 4, 2016 14:36
-
-
Save geronimod/6ea0302a7ad3c2a2df9c1a2aa402b0c8 to your computer and use it in GitHub Desktop.
bash branch info
This file contains hidden or 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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/" | |
} | |
export BRANCH_INFO='$(parse_git_branch)' | |
export CURRENT_BRANCH='$BRANCH_INFO' | |
export PS1="\[\033[00;32m\]\u\[\033[01m\]@\[\033[00;36m\]\h\[\033[01m\] \! \[\033[00;35m\]\w\[\033[00m\]\[\033[00m\] ($BRANCH_INFO)\$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment