Ignore ORIG_HEAD in zsh git autocomplete

I use oh-my-zsh and git autocomplete.

If I type git checkout org and press TAB, I get the following results:

 ORIG_HEAD origin/HEAD origin/mybranch 

How to make autocomplete ignore ORIG_HEAD ?

+7
source share
2 answers

Add this to your .zshrc :

 zstyle ':completion:*:*' ignored-patterns '*ORIG_HEAD' 

This will ignore all files ending in ORIG_HEAD when multiple files exist.

+9
source
  • You can edit / usr / share / zsh / functions / Completion / Unix / _git and delete ORIG_HEAD in the following line (line 5091 for me):

    for f in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do

  • You can remove .git/ORIG_HEAD :)

+1
source

All Articles