
How To Set Up Git Tab Completion
1
Download the git completion shell script
First, open a shell and navigate to your home directory because that’s where the script will reside.
cdNow download the git completion script using one of the following methods.
Using curl:
curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bashUsing wget:
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash2
Source the git completion file
source ~/git-completion.bashIn most cases, you’ll want to source this file automatically whenever you start a new shell. To do so, open your ~/.bashrc file and append the command from above. Once you save the file, all new shells will automatically source the file.
Note: The tilde (~) refers to your home directory.
3
Try it out
Move to a git controlled directory and type:
git checkout You should see a list of all of the possible branches that can be checked out!