Skip to content

Instantly share code, notes, and snippets.

@ddeyoung
Created October 18, 2011 01:12
Show Gist options
  • Save ddeyoung/1294376 to your computer and use it in GitHub Desktop.
Save ddeyoung/1294376 to your computer and use it in GitHub Desktop.
Set git autocompletion and PS1 integration
# Install bash completion
$ brew install bash-completion
# Install Homebrew's own completion script:
$ ln -s "/usr/local/Library/Contributions/brew_bash_completion.sh" "/usr/local/etc/bash_completion.d"
# Add the following to your .bash_profile
# include $HOME/bin in your path
export PATH="$HOME/bin:$PATH"
# Set git autocompletion and PS1 integration
GIT_PS1_SHOWDIRTYSTATE=true
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\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