git completion in zsh

Just figured out how to get git tab completion working in zsh on a Mac. Turns out that the completion scripts use a bunch of extra git commands such as git-ls-files. These commands need to be in your path for the completion to work. If you installed git using the OS X installer, you need to add this directory to your path:

/usr/local/git/libexec/git-core

3 thoughts on “git completion in zsh

  1. Thanks a bunch! Not having completion was driving me crazy.

    Since this is for Mac OS X, I thought I would pass along another tip for adding to the PATH. /usr/libexec/path_helper looks for files in /etc/paths.d and appends their contents to the PATH.

    Thus to get git tab completion on my Mac:
    echo “/usr/local/git/libexec/git-core” | sudo tee -a /etc/paths.d/git

    Like

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s