我严格遵守了这些说明,包括关于密码缓存的部分。看起来指令是错误的,因为每次我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

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


当前回答

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

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

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

其他回答

在mac上执行以下命令:

Git配置——全局凭据。辅助osxkeychain

这招对我很管用:

git credential-manager-core configure

我在windows7上使用AptanaStudio3时遇到了这个问题。这帮助了我:

git config --global credential.helper wincred

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

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

这就消除了恼人的信息:

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

在旧的Ubuntu Linux系统上:

git config --global credential.helper store