Created
December 1, 2010 10:27
-
-
Save johnjohndoe/723302 to your computer and use it in GitHub Desktop.
Colored bash prompt showing git branch (.bash_rc)
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
# Set git tab completion and PS1 integration | |
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then | |
. /usr/local/git/contrib/completion/git-completion.bash | |
fi | |
GIT_PS1_SHOWDIRTYSTATE=true | |
if [ -f /opt/local/etc/bash_completion ]; then | |
. /opt/local/etc/bash_completion | |
fi | |
# Colored bash prompt showing git branch and current state. | |
BROWN='\[\033[33m\]' | |
GREEN='\[\033[32m\]' | |
RED='\[\033[31m\]' | |
WHITE='\[\033[00m\]' | |
PS1=$WHITE'['$BROWN'\W'$GREEN'$(__git_ps1)'$WHITE']\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment