Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

zsh

oh-my-zsh

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?

like image 312
zianwar Avatar asked Jun 19 '14 19:06

zianwar


3 Answers

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

  1. The easiest way to get auto-completion working is to install it through Homebrew (it will work for zsh as well as bash.):
brew install bash-completion
  1. 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
  1. Save the file and do a source ~/.zshrc and you will be good
like image 101
kuzyn Avatar answered Nov 17 '22 04:11

kuzyn


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

like image 31
Jas Avatar answered Nov 17 '22 03:11

Jas


In Git for Windows, this message is emitted during execution of the file etc/profile.d/git-prompt.sh, if the shell is not Bash.

git-prompt.sh sources git-completion.bash without looking at the shell name. That file checks that it is not run by Bash, emits that warning message and exits.

Here is the link to the respective code: https://github.com/git/git/blob/master/contrib/completion/git-completion.bash#L3509

You should look inside git-completion.zsh located in the same directory near this file and follow installation instructions provided in the comments in the beginning:

# The recommended way to install this script is to make a copy of it as a
# file named '_git' inside any directory in your fpath.
#
# For example, create a directory '~/.zsh/', copy this file to '~/.zsh/_git',
# and then add the following to your ~/.zshrc file:
#
#  fpath=(~/.zsh $fpath)
like image 2
wl2776 Avatar answered Nov 17 '22 03:11

wl2776