Git autocomplete on the shell prompt

4) Git autocomplete on the shell prompt

Go here, right-click and choose “Save As…”, save this file to your home directory as ~/.git-completion.bash
(Remember, that ~ means your home directory.) Then add the following line to your ~/.bash_profile script

source ~/.git-completion.bash

That will tell your shell prompt to load the git autocomplete script.

When switching into a git branch, you can now hit tab for auto-complete and tab-tab for auto-suggest, just like filepaths in your Unix system, to navigate and choose the git branch name you want.