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?
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 good~/.zshrc
.zshrc
file. We use ohmyzsh and autocompletion is already implemented.
Jan 26, 2022 at 16:33
For 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
~/.profile
does not exist, so if you remove that line when copying over from ~/.bash_profile
to ~/.zprofile
you should not get that error
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)
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
_git:12: command not found: ___main _git:15: command not found: _default complete:13: command not found: compdef
git-completion.zsh:.:48: no such file or directory: _git:19: command not found: _default
at MacOS 11.
Nov 18, 2020 at 17:41