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?
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
brew install bash-completion
~/.zshrc
:# auto-completion
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
. /opt/local/etc/profile.d/bash_completion.sh
fi
source ~/.zshrc
and you will be goodFor me, I simply had copied over the contents of ~/.bash_profile
to ~/.zprofile
when migrating to zsh. I simply removed this line which was the root cause of the warning message:
source ~/.profile
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With