I have a convenient dotfiles repo on Github for you all to look at, here. FYI, git is installed via Homebrew, as with most of the executables on my system.

My git-completion in zsh works fine when I use no aliases, such as:

% git add fi<TAB> # => file.rb

But if I add an alias in my .zshrc (actually cormacrelf-dotfiles-repo/zsh/aliases.zsh), like:

alias ga="git add"
compdef _git ga=git-add

... trying to complete anything (not just files: branches, etc.) results in an error:

% git add fi
_git:19: parse error: condition expected: 1
  • Did you try "git add fi<tab>' or 'ga <tab>'. Question sounds confusing. – Cougar May 28 '12 at 8:06

setopt no_complete_aliases in your .zshrc. Yes I know, the name sounds wrong, but that works.

  • Legend! This seems to work for me. – zelk Jul 6 '12 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.