我正在使用几个存储库,但最近我只在我们的内部存储库中工作,一切都很好。

今天我不得不提交并将代码推到另一个,但我遇到了一些麻烦。

$ git push appharbor master
error: The requested URL returned error: 403 while accessing https://gavekortet@appharbor.com/mitivo.git/info/refs?service=git-receive-pack
fatal: HTTP request failed

没有什么我能做的,这将再次带来密码输入。

我如何重置系统上的凭据,以便Git询问我该存储库的密码?

我试过:

Git配置——global——unset core.askpass

以便取消设置密码

Git配置凭证。Helper '缓存超时=1'

为了避免凭证缓存…

似乎什么都不管用;谁有更好的主意?


当前回答

当做一个'git拉'时,有同样的错误,这就是我如何修复它。

将repo更改为HTTPS 执行命令git config——system——unset credentials .helper 执行命令git config——system——add credential。辅助经理 测试命令git拉 在弹出的登录窗口中输入凭证。 Git拉取成功。

其他回答

如果你想让git忘记旧保存的凭证并重新输入用户名和密码,你可以使用下面的命令来完成:

git credential-cache exit

运行以上命令后,如果您尝试推送任何东西,它将提供输入用户名和密码的选项。

请执行以下命令-

git config --global credential.helper cache

然后运行任何git命令,比如git pull,它会要求输入用户名和密码。输入详细信息,如果您想存储您的git凭据,请运行以下命令-

git config --global credential.helper store

在PowerShell控制台中执行以下命令清除Windows缓存中的Git凭据管理器:

rm $env:LOCALAPPDATA\GitCredentialManager\tenant.cache

或在Cmd.exe中

rm %LOCALAPPDATA%\GitCredentialManager\tenant.cache

如果您使用密钥对进行身份验证,则可以删除或移动您的私有密钥,或者停止密钥代理并尝试。

如果使用Git凭据管理器for Windows(当前版本通常使用):

git credential-manager clear

这是在2016年年中增加的。检查是否使用了凭据管理器。

git config --global credential.helper
→ manager