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 :)

Elsewhere , ,

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>