This tip only works on Unix-based systems (Linux, Mac OS…)
Download the file git-completion.bash from Github.
Add this line to your bash profile (e.g.
.bashrc), I assume you have copied
git-completion.bash at the root of your home folder.
.bashrc doesn’t exist, create it first.
This line will load
git-completion.bash automatically when you open a bash session.
You will then be able to autocomplete all your Git commands (using Tab), and also access advanced completion e.g. look for local and remote branches by starting typing the name.