When using OSX’s git, after I modify a file I can simply do git commit
, and that’ll auto complete the file’s name to the one that was modified. Howe
If you used homebrew to install git, then probably there is no need to install anything to support git completion. "git-completion.bash" file is somewhere (mine was here: /usr/local/git/contrib/completion/git-completion.bash)
All you need to do is to find the file: sudo find / -type f -name "git-completion.bash"
Then source its path in your .bash_profile. For example I needed to add this line to my ~/.bash_profile:
source /usr/local/git/contrib/completion/git-completion.bash
Don't forget to source your ~/.bash_profile or reopen your terminal ;)
from: how-enable-git-tab-completion-bash-mac-os-x