One thing I often wished to have when using Git was the ability to autocomplete Git commands and branch names. As I had to learn this week from Markus Prinz’ article A few of my Git tricks, tips and workflows, Git comes with an autocompletion script for the Bash shell.
But to use the autocompletion, you have to enable it. To do that, add the following snippet to your
~/.bashrc file (if you are using a Mac, see the aforementioned article):
You can then either reload the
.bashrc file with
source ~/.bashrc or open a new shell to see the autocompletion in action.