Skip to content

Instantly share code, notes, and snippets.

@oscarrenalias
Created August 24, 2012 18:22
Show Gist options
  • Select an option

  • Save oscarrenalias/3453929 to your computer and use it in GitHub Desktop.

Select an option

Save oscarrenalias/3453929 to your computer and use it in GitHub Desktop.
Enabling git integration with Bash in OS X
git config --global color.branch auto
git config --global color.diff auto
git config --global color.status auto
# This code is to be added to ~/.profile or ~/.bash_profile
# Set git autocompletion 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
PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[32m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment