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

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

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


当前回答

如果您不想删除或卸载凭据管理器:请参阅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证书管理器?

其他回答

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

我曾经有过这个问题,我只删除了git-credential-manager.exe文件:

C:\Program Files\Git\mingw64\libexec\git-core

我不得不使用VSTS的另一个选项:

Git配置——全局凭据。modalprompt假

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

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

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

我在Ubuntu 18.10 (Cosmic Cuttlefish)上遇到了同样的问题,无法使用任何正常方法删除。 我使用git config -global -unset credential。帮手,这似乎奏效了。