Aaron Presley

← Writing
Git Branch Tab Complete

August 18, 2014

Long git branches happen to the best of us. This is a great way to add tab-complete to your git commands - including your branches.

For the sake of documentation, here's a direct copy of the instructions:

Download the git-complete.bash Script

Run this command to download the git-complete.bash script to your home directory:

curl https://raw.githubusercontent.com/git/git/master/contrib/
completion/git-completion.bash -o ~/.git-completion.bash

Update Your Profile:

Add this to your ~/.profile:

if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi

Reload your profile and you've got all the tab-complete goodness you can handle.