If you want to enable tab auto complete at the command line on Mac OSX terminal, there is a handy auto-completion script you can use.
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
Using git-completion
script to enable auto complete for GIT commands
-
- Download and save the git-completion script to your home directory
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
- Then open the
.bash_profile
file in your home directoryvi ~/.bash_profile
- Add this at the end of .bash_profile
if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash fi
- Make the .git-completion.bash in your home directory executable
chmod +x ~/.git-completion.bash
- Finally reload the .bash_profile with the following command, or just close and re open the shell and your git auto completion should be working.
source ~/.bash_profile
- Download and save the git-completion script to your home directory
The same method can be adapted to Centos6, Centos 7, Ubuntu, RHEL or any other bistro.
Feel free to leave a comment if you face any issues.