git - 忽略 zsh git autocomplete 中的 ORIG_HEAD

标签 git zsh zsh-completion

我使用 oh-my-zsh 和 git 自动补全。

如果我输入 git checkout org 并按下 TAB,我会得到这些结果:

ORIG_HEAD
origin/HEAD
origin/mybranch

如何让自动完成功能忽略 ORIG_HEAD

最佳答案

将此添加到您的 .zshrc:

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

当存在多个文件时,这将忽略所有以 ORIG_HEAD 结尾的文件。

关于git - 忽略 zsh git autocomplete 中的 ORIG_HEAD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12508595/

相关文章:

bash - 为什么 `if $(true) ; then ... fi`会成功?

ZSH 完成基于之前的标志

zsh - zsh 中的多点路径,如 `cd ....`

zsh: 完成 `command1` 与 `command2 ARG` 相同

git - 将 github 提交/pull 请求作为补丁应用

zsh - zsh bindkey 命令列表

git - 我应该使用 SVN 还是 Git?

arrays - 为什么 zsh 中 read -a 失败

git - 应用 git stash 时,我可以影响 "recursive"使用的 merge 策略吗?

git - 更新 gitlab merge 请求时避免使用 push --force