Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Colored bash prompt showing git branch (.bash_rc)
# 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