Denis Barushev


Adding Bash Completion for Git on Mac OS X Snow Leopard

Copy this code and paste it into Terminal.

This also should work for any *NIX.


There are the easiest ways to add bash completion for git.

For Mac OS X

Install git via MacPorts:

sudo port install git-core +bash_completion

Then add the following lines at the end of your ~/.profile:

if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion

For Ubuntu

sudo aptitude install git-completion

For Fedora

sudo smart install bash-completion