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

廉价感情. 提交于 2020-07-05 05:23:24

问题


I'm using oh-my-zsh and I get this error every time I open terminal:

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

is there any solution to that?


回答1:


Might seems silly, but make sure that you source your ~/.zshrc file (create one if it does not exists). On OSX I completely forgot that I had switched to zsh, and got the error you mentioned because I was doing source ~/.bashrc

The easiest way to get auto-completion working is to install it through Homebrew with brew install bash-completion (it will work for zsh as well as bash) and then put this into your ~/.zshrc:

# auto-completion
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
  . /opt/local/etc/profile.d/bash_completion.sh
fi

Save the file and do a source ~/.zshrc and you will be good




回答2:


Type this in your console:

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

Add this in one of your .profile / .bashrc / .zshrc:

source ~/git-completion.zsh




回答3:


For me, I simply had copied over the contents of ~/.bash_profile to ~/.zprofilewhen migrating to zsh. I simply removed this line which was the root cause of the warning message:

source ~/.profile



来源:https://stackoverflow.com/questions/24315201/warning-this-script-is-deprecated-please-see-git-completion-zsh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!