Git Autocomplete for Bash Shells

Here are a few very simple steps to enable git autocomplete on the command line for your bash shell. When it is working, you will be able to hit tab to autocomplete. This works for options as well (i.e., type in “git checkout –” and then hit tab).

To get this working, in your terminal, type:

curl “https://raw.github.com/git/git/master/contrib/completion/git-completion.bash” -o ~/.git-completion.bash

Or, if you would rather wget, you can type:

wget “https://raw.github.com/git/git/master/contrib/completion/git-completion.bash” -O ~/.git-completion.bash

Add this line to your ~/.bash_profile

source ~/.git-completion.bash

In your terminal, type:

source ~/.bash_profile

You’re good to go. Enjoy the git autocomplete!

About these ads
This entry was posted in Open Source and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s