I stumbled upon some instructions in the book "Pro Git"
Download this file : https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
If you use the Bash shell, Git comes with a nice auto-completion script you can enable. Download it directly from the Git source code at https://github.com/git/git/blob/master/contrib/completion/git-completion.bash . Copy this file to your home directory, and add this to your
(putting this line in .bashrc will not work in Mac OS X systems which I discussed here: Why doesn't Mac OS X source ~/.bashrc?)
Put this file
/opt/local/etc/bash_completion.dif you want bash completion (for the git command) to work on all user accounts. (As if bash reads all the scripts in
If you want to set up Git to automatically have Bash shell completion for all users, copy this script to the
/opt/local/etc/bash_completion.ddirectory on Mac systems or to the
/etc/bash_completion.d/directory on Linux systems. This is a directory of scripts that Bash will automatically load to provide shell completions.
I found out that Mac OS's bash DOES NOT read scripts inside
/opt/local/etc/bash_completion.d. I put the file there (I created all the folders, because they didn't exist) :
And git completion doesn't work on any account.
Does Mac OS X's bash read scripts for all users from
Is the "Pro Git" book wrong ? Can I report it on their Github page ?
Or am I wrong ?