我注意到,在最新版本的Git中,默认现在是弹出一个“Git凭证管理器for Windows”对话框,而不是每次在Bash提示符中提示我输入密码。

我真的很讨厌这种行为。我如何禁用它,然后回到每次在Bash shell中输入密码?

顺便说一下,我不希望Git以任何方式缓存我的凭据,无论是通过Windows凭据还是一些内部守护进程。我想禁用所有凭据缓存。


当前回答

我有另一个问题,设置git不提示任何密码,我学会了另一个命令行技巧,可以用于此目的。

如果你想要一个临时解决方案的终端会话,这可能会派上用场:

Git -c凭证。Helper = <其余的命令>

其他回答

Use:

C:\Program Files\Git\mingw64\libexec\git-core                                                                       
git credential-manager uninstall --force    

这适用于Windows系统。我测试过了,对我很有效。

Visual Studio Code: Menu File→Preferences→Configuration→GitHub→gitAuthentication: false。将存储库的协议从https://更改为git://,并对git使用公钥身份验证。

在“user”文件夹下,c://user,,查看“。文件,然后删除HTTP和代理行。

如果您不想删除或卸载凭据管理器:请参阅https://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials/1054253#answer-1054253以获得适合我的解决方案。

说明等,在该页面(链接,以防止重复的内容在同一网站家族)。


TL;DR:这现在位于我的自动bash脚本之上:

# https://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials
export GIT_TERMINAL_PROMPT=0
# next env var doesn't help...
export GIT_SSH_COMMAND='ssh -oBatchMode=yes'
# these should shut up git asking, but only partly: the X-windows-like dialog doesn't pop up no more, but ...
export GIT_ASKPASS=echo
export SSH_ASKPASS=echo
# We needed to find *THIS* to shut up the bloody git-for-windows credential manager: 
# https://stackoverflow.com/questions/37182847/how-do-i-disable-git-credential-manager-for-windows#answer-45513654
export GCM_INTERACTIVE=never

证书管理器棺材上的最后一颗钉子是Martin Ba上面回答的唯一的位(GCM_INTERACTIVE):我如何禁用Windows的Git证书管理器?

也许问题出在Sourcetree上。

点击工具→选项 取消选中“每[10]分钟检查默认远程更新” 重启Sourcetree !