Git选项卡完成在Mac上的zsh中不起作用 [英] Git tab completion not working in zsh on mac

查看:113
本文介绍了Git选项卡完成在Mac上的zsh中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论我尝试什么,我似乎都无法在我的zsh shell中使git tab/autocomplete工作.我已经下载了bash-completion脚本和zsh-completion脚本,并按照说明进行了操作,但是我无法使其工作.

No matter what I try and do I can't seem to make git tab/auto completion work in my zsh shell. I've downloaded the bash-completion script and the zsh-completion one and followed the instructions, but I can't make it work.

我已经重新安装了oh-my-zsh,但这似乎没有帮助或没有任何作用.

I've reinstalled oh-my-zsh but that didn't seem to help or make any difference.

任何能够使它工作的人都可以向我描述他们的设置,以便我可以尝试进行仿真以使其对我有用吗?

Can anyone who's got it working describe to me their setup so I can try an emulate it to get it working for me?

具体来说,到目前为止我所做的是:

To be specific, what I've done so far is:

  • Switched to using zsh as my default shell
  • Installed oh-my-zsh
  • Downloaded https://github.com/git/git/blob/master/contrib/completion/git-completion.bash and saved it in ~/.completion/git/git-completion.sh
  • Downloaded https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh and saved that in ~/.zsh/_git
  • Added zstyle ':completion:*:*:git:*' script ~/.completion/git/git-completion.sh

没有运气.

推荐答案

答案是我的.zshrc文件中有alias git=hub.请参阅 https://github.com/github/hub 以获取有关中心的信息(很棒).

The answer was that I had alias git=hub in my .zshrc file. See https://github.com/github/hub for info on hub (it's awesome).

以下是有关我在使用hub和git完成时遇到的问题的信息的链接: https://github.com/github/hub/issues/586#issuecomment-47727226

Here's a link to info about the problem I was having with hub and git completion: https://github.com/github/hub/issues/586#issuecomment-47727226

这篇关于Git选项卡完成在Mac上的zsh中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆