Git tab autocomplete
By Mike Street
The following adds autocomplete to your git repos - branches when checking out and other git commands.
Download this bash file and save somewhere handy (/root
or similar).
One way of getting it straight onto your server is using wget
wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
Then edit your ~/.bash_profile
and put the following code in:
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
Logout, log back in - you should now be able to type git che[tab]
for it to autocomplete to git checkout
. Also works with branches and other git commands.