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.
git-completion script to enable auto complete for GIT commands
- Download and save the git-completion script to your home directory1curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
- Then open the
.bash_profilefile in your home directory1vi ~/.bash_profile
- Add this at the end of .bash_profile123if [ -f ~/.git-completion.bash ]; then. ~/.git-completion.bashfi
- Make the .git-completion.bash in your home directory executable1chmod +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.1source ~/.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.