I just switched from bash to using zsh 4.3.4 on Ubuntu Hardy. I'm developing with git and I find myself constantly fighting with the default git completions: filename completion tries to be smart by detecting what you've added or removed (using git-ls-files) but sometimes it gets things wrong---e.g., if you are in a sub-directory. It also doesn't know about my custom git aliases (e.g., git ci as an alias for commit).

zsh superusers, how should I improve this situation?

Here are some of my thoughts, though I don't know how to implement them as I'm new to zsh, so maybe you can help or offer your own:

  • Disable git filename completion, leaving just branch/tag/command-name/command-option completion.
  • Replace the "smart" filename completion with the regular zsh filename completion.
  • Get a newer _git completion file, if it fixes these bugs, and override the system one.


  • Have you tried github.com/robbyrussell/oh-my-zsh
    – ukanth
    Oct 6, 2009 at 15:34
  • Yes, as far as I can tell, it just adds a git prompt and doesn't tweak the underlying completions.
    – Emil Sit
    Oct 6, 2009 at 18:42
  • Can someone just tell us how to disable all the "smart" completion for all git commands? They do too much IO. The shell needs to respond instantly. I just want to go back to good old simple filename completion for git commands. Every time I do a web search for this I just get a maze of generic zsh man page info. Jul 13, 2010 at 19:58
  • 2
    FYI for anyone who wants to just disable the annoying git completion that causes the shell to block doing IO, on Ubuntu 10.04, I just did this: sudo mv /usr/share/zsh/functions/Completion/Unix/_git /usr/share/zsh/functions/Completion/Unix/OFF_git Sep 28, 2010 at 5:56

2 Answers 2


For large projects, even the newer git completion scripts are far too slow. To disable them and just use normal file completion, place the following command in your .zshrc:

compdef -d git

Try upgrading to the latest version of Zsh. I just upgraded from 4.3.4 to 4.3.10 and it at least fixes the problem with Git aliases not completing.

Instead of hacking my installation I added this to my local .zshrc:

if [ "$SHELL" != "$customzsh" ]; then
  export SHELL=$customzsh
  exec $customzsh

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.