我严格遵守了这些说明,包括关于密码缓存的部分。看起来指令是错误的,因为每次我git push origin master都会得到这个错误:

git: 'credential-cache' is not a git command. See 'get --help'.

... 这时我必须输入我的用户名和密码。这样做之后,我再次看到相同的错误消息,然后是git push的输出。

下面是我的.gitconfig文件的内容:

[user]
    name = myusername
    email = myusername@myemaildomain.com
[credential]
    helper = cache

要清楚,在我安装Git并运行Git Bash后,下面是我输入的内容:

git config --global user.name "myusername"
git config --global user.email "myusername@myemaildomain.com"
git config --global credential.helper cache

请帮助。这太令人沮丧了!


当前回答

在.gitconfig的[credential]部分中有三个不同的helper=条目,其中一个是空的。删除另外两个并保留helper=wincred为我解决了这个问题。

BTW:我不知道为什么,但我没有立即找到我的.gitconfig。然后我在c:\ users \username中找到了它

其他回答

我通过从特定项目的配置中删除凭据部分来修复这个问题:

只需输入:git config -e 在编辑器中,我删除了整个部分[credential] helper = cache。

这就消除了恼人的信息:

'credential-cache'不是Git命令。参见'git -help'。

我也得到类似的错误,当我试图使用命令“git拉”从主分支。

Error: "git: 'credential-manager' is not a git command. See 'git --help'." 

我执行下面两个命令,问题得到解决。

$ git config --global --unset credential.helper
$ git config credential.helper store

在旧的Ubuntu Linux系统上:

git config --global credential.helper store

为了其他人有这个问题-我降落在这里,因为我试图得到可爱的我如何设置一个新的github存储库,但每个设置页面凭据帮助不工作,除非你克隆一个存储库。

提示:凭据帮助器仅在克隆HTTPS存储库URL时有效。如果使用SSH存储库URL,则使用SSH密钥进行身份验证。本指南提供生成和使用SSH密钥对的帮助。

在我的案例中,这个命令解决了这个问题:

git config --global credential.helper manager-core --replace-all

使用新的网络核心凭据管理器。