尝试在Windows 7上设置git凭证缓存后,我现在想放弃这个想法并从git中删除此错误消息和设置。
git: 'credential-cache'不是git命令。
这个相关的问题 展示了如何通过安装额外的软件使凭证缓存工作来修复此错误 - 然而,我希望彻底删除此设置。
我该怎么做?
我已经尝试过:
git config --global --remove-section credential-cache
和其他变化形式。
同时,在我的.git/config文件中也不存在。
尝试在Windows 7上设置git凭证缓存后,我现在想放弃这个想法并从git中删除此错误消息和设置。
git: 'credential-cache'不是git命令。
这个相关的问题 展示了如何通过安装额外的软件使凭证缓存工作来修复此错误 - 然而,我希望彻底删除此设置。
我该怎么做?
我已经尝试过:
git config --global --remove-section credential-cache
和其他变化形式。
同时,在我的.git/config文件中也不存在。
运行git config --global -e
命令允许我从全局 git 配置中删除有问题的配置设置。
[credential]
helper = winstore
我运行了git config --global -e
,但它没有包含任何与凭据相关的部分。
然而,当我运行git config -e
时,我确实发现有一个[credential]
部分。
以下命令解决了我的问题。
git config --remove-section credential
我也遇到了同样的错误:
$ git push -u origin master
git: 'credential-cache' is not a git command. See 'git --help'.
Branch master set up to track remote branch master from origin.
Everything up-to-date
所以我决定完全摆脱凭证缓存,我在Git bash中实现了这一点:
git config --global -e
然后我找到了
[credential]
helper = cache
然后我删除了它,保存文件后再次尝试的结果是:
$ git push
Everything up-to-date
所以错误已经消失了。
再次确认 Bradley Flood 正确的说法,对我而言运行 git config --global -e
也起作用了。要补充一点,我删除的配置设置是:
[credential]
helper = winstore
我在Ubuntu中解决了这个问题,只需在终端中输入以下命令。
sudo git config --system --unset credential.helper manager
这对我很有用。
git config --system -e
按下'I'进行编辑;
删除代码。
[credential]
helper=xxxxxx
按下“Esc”关闭编辑器,输入“:wq”退出编辑器;
$ git push
git: 'credential-user.name' is not a git command. See 'git --help'.
git: 'credential-user.email' is not a git command. See 'git --help'.
git: 'credential---replace-all' is not a git command. See 'git --help'.
所以,我决定摆脱所有的凭证缓存:
git config --global -e
在这里,您可以删除所有助手线路 -
(意思是可以删除所有辅助线)[credential]
helper = xxxx
保存后再尝试:
$ git push
Everything up-to-date
git config --global credential.helper store
[credential]
helper = store
然后重新尝试git push
并输入用户名和密码。完成后,您就不再需要为git pull
或git push
命令提供用户名和密码。