Autocompletion in Git

Do you like hitting tab to autocomplete long file name and commands? Do you use git? Then you need to install this right now! Git doesn’t autocomplete commands or branch names, but you can enable it with this script.

Grab it from here: https://raw.github.com/git/git/master/contrib/completion/git-completion.bash

Save it in ~/.git-completion.bash and add this line to your ~/.bash_profile: source ~/.git-completion.bash

You are now a git speed ninja. You’ll wonder what to do with all your extra time (and why git doesn’t include this be default).

Thanks to Mohammed Buttu and simont on StackOverflow.

Comments