Autocomplete git branch name

Turns out it’s possible to enable autocompletion of git branch names when working on the command line. The script can be automatically installed on OS X using these commands:

$ curl -G https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.sh
$ echo 'source ~/.git-completion.sh' >> ~/.bash_profile

Don’t forget to re-open any already open Terminal windows.

(via @decthomas)

UPDATE: I’ve been notified that this script also autocompletes names of remotes and the like 🙂

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.