Created
March 6, 2014 17:56
-
-
Save ConnorDoyle/9395589 to your computer and use it in GitHub Desktop.
Git Branch - Bash Profile
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 branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
yellow=$(tput setaf 3) | |
green=$(tput setaf 2) | |
cyan=$(tput setaf 6) | |
purple=$(tput setaf 5) | |
bold=$(tput bold) | |
reset=$(tput sgr0) | |
export PS1='\[$yellow$bold\]\u\[$reset\]@\[$cyan$bold\]\H\[$reset\]:\W\[$green$bold\]$(parse_git_branch) \[$purple$bold\]\$\[$reset\] ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment