Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
警告:此脚本已弃用,请参阅git-completion.zsh_Git_Zsh_Oh My Zsh - Fatal编程技术网

警告:此脚本已弃用,请参阅git-completion.zsh

警告:此脚本已弃用,请参阅git-completion.zsh,git,zsh,oh-my-zsh,Git,Zsh,Oh My Zsh,我正在使用oh my zsh,每次打开终端时都会出现以下错误: WARNING: this script is deprecated, please see git-completion.zsh 有什么解决办法吗?在控制台中键入以下内容: curlhttps://github.com/git/git/raw/master/contrib/completion/git-completion.zsh -OL 将此添加到您的.profile/.bashrc/.zshrc: source~/git c

我正在使用oh my zsh,每次打开终端时都会出现以下错误:

WARNING: this script is deprecated, please see git-completion.zsh

有什么解决办法吗?

在控制台中键入以下内容:

curlhttps://github.com/git/git/raw/master/contrib/completion/git-completion.zsh -OL

将此添加到您的
.profile
/
.bashrc
/
.zshrc


source~/git completion.zsh
可能看起来很傻,但请确保您的
~/.zshrc
文件是源文件(如果不存在,请创建一个)。在OSX上,我完全忘记了我已经切换到了zsh,并且得到了您提到的错误,因为我正在执行
source~/.bashrc

  • 实现自动完成的最简单方法是通过安装(它将适用于zsh和bash):
  • brew安装bash完成
    
  • 将其放入您的
    ~/.zshrc
  • 保存该文件并执行
    source~/.zshrc
    操作,您会很好

  • 对我来说,我只是在迁移到zsh时将
    ~/.bash_profile
    的内容复制到
    ~/.zprofile
    。我只是删除了这一行,这是警告消息的根本原因:


    source~/.profile

    我认为这是一个很好的问题,因为很多时候人们会简单地用谷歌搜索出现在命令行中的警告:1:找不到匹配项:::::所有文件_标记:comptags:36:只能从完成函数调用_标记:comptry:55:只能从完成函数调用_标记:comptags:60:只能从完成函数调用_标记:comptags:67:只能从完成函数zsh--版本zsh 5.0.5(x86_64-pc-linux-gnu)#我也使用Oh My Zsh。
    \u git:12:找不到命令:\uuuuu main\u git:15:找不到命令:_defaultcomplete:13:找不到命令:compdef
    它说的是
    git completion.Zsh::48:没有这样的文件或目录:_git:19:找不到命令:\u default
    在MacOS 11上。这解决了我切换到Zsh后两个小时的挣扎。非常感谢。你帮我节省了很多时间。非常感谢。我刚切换到macOS,你是唯一一个让我创建
    ~/.zshrc
    Tks bro的人,我是新的im Mac。这对我没用!:(@EzequielDeSimone我不得不注释掉“#source~/git completion.bash”在my zshrc中,即使按照此答案上的说明操作,也可以清除警告。这可能也会有帮助。来源:没有这样的文件或目录:/Users/myuser/。profile@IgorGanapolsky看起来
    ~/.profile
    不存在,因此如果在从
    ~/.bash_profile
    复制到
    ~/.zprofile
    时删除该行,您可以不应该得到那个错误
    # auto-completion
    if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
      . /opt/local/etc/profile.d/bash_completion.sh
    fi