Git tab autocomplete

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.

This website is currently having a full content audit - apologies if some of the code or content looks a bit funky!

View this post on Gitlab

You might also enjoy…

  • Compiling Less on the Command Line

    Posted on 19th October 2013.

    We have been using LESS for a while now, but our process involved including the less.js in the header during development, compiling the LESS using an app before launch and then maintaining the site using the css.

  • Trailwalker 2013

    Posted on 29th July 2013.

    The Trailwalker event is something I've had my eye on for a while. 100km over 30 hours seemed like a sporting challenge I could do. I was 16 when a friend started ...

Mike Street

Written by Mike Street

Mike is a front-end developer from Brighton, UK. He spends his time writing, cycling and coding. You can find Mike on Twitter.