Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
How to get git-completion.bash to work on Mac OS X?
sudo port install git-core +bash_completion
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
GIT_PS1_SHOWDIRTYSTATE=true
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\[\033[01;31m\]$(__git_ps1 " {%s}")\[\033[00m\]\$ '
@aratak

This comment has been minimized.

Show comment Hide comment
@aratak

aratak Oct 3, 2011

  • Install homebrew
  • Install Git and bash-completion: brew install git bash-completion
  • Add bash-completion to your .bash_profile:
if [ -f `brew --prefix`/etc/bash_completion ]; then
  . `brew --prefix`/etc/bash_completion
fi

aratak commented Oct 3, 2011

  • Install homebrew
  • Install Git and bash-completion: brew install git bash-completion
  • Add bash-completion to your .bash_profile:
if [ -f `brew --prefix`/etc/bash_completion ]; then
  . `brew --prefix`/etc/bash_completion
fi
@stevenirby

This comment has been minimized.

Show comment Hide comment
@stevenirby

stevenirby Jul 30, 2013

Thanks @aratak that worked for me!

Thanks @aratak that worked for me!

@rsvalerio

This comment has been minimized.

Show comment Hide comment
@rsvalerio

rsvalerio Dec 20, 2013

worked here too... Thanks @aratak

worked here too... Thanks @aratak

@Aster89

This comment has been minimized.

Show comment Hide comment
@Aster89

Aster89 Oct 4, 2016

Not for me. Can anyone help?

Aster89 commented Oct 4, 2016

Not for me. Can anyone help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment