Autocomplete for Git
Fabian Piau | Saturday May 20th, 2017 - 02:27 PMNote
This tip only works on Unix-based systems (Linux, Mac OS…)
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.
source ~/git-completion.bash
If .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.
Recent Comments