oh-my-zsh slow, but only for certain Git repo

You can add this to your git config and zsh won't check the status anymore

git config --add oh-my-zsh.hide-status 1
git config --add oh-my-zsh.hide-dirty 1

Explanation

There are two central git functions in in lib/git.zsh:

  • git_prompt_info()
  • parse_git_dirty()

Each Method has a git config switch to disable it:

  • oh-my-zsh.hide-status
  • oh-my-zsh.hide-dirty

Some themes create their own git queries and sometimes ignore these flags.


Oh_my_zsh seems to be slow for some repos because it checks the status of the repo after each command. This behaviour can be overridden in the new version of .oh_my_zsh . Just Uncomment the following line in .zshrc:

DISABLE_UNTRACKED_FILES_DIRTY="true"

After this, restart your terminal or run the following:

source ~/.zshrc


It could be the theme calling git and rvm stuff after every command.

For me, changing ZSH_THEME="juanghurtadoto" to ZSH_THEME="miloshadzic" removed the 2 second delay after every command completely.

Themes can be found at https://github.com/robbyrussell/oh-my-zsh/wiki/themes


For me it's slow on VirtualBox (the guest) because I'm using a synced folder. I still want it enabled on OS X (the host) where it's fast enough. Instead of using a local config setting which is stored with the repo and would change it both on the guest and host, I use a global config setting only on the guest:

git config --global --add oh-my-zsh.hide-dirty 1

If I want it just for a single repo:

git config --add oh-my-zsh.hide-dirty 1