I use oh-my-zsh and git autocomplete.
If I type git checkout org and press TAB, I get the following results:
git checkout org
ORIG_HEAD origin/HEAD origin/mybranch
How to make autocomplete ignore ORIG_HEAD ?
ORIG_HEAD
Add this to your .zshrc :
.zshrc
zstyle ':completion:*:*' ignored-patterns '*ORIG_HEAD'
This will ignore all files ending in ORIG_HEAD when multiple files exist.
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 :)
.git/ORIG_HEAD