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

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

$ 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使用Windows存储凭据。

你所要做的就是删除存储在Windows帐户中的凭据:

其他回答

在Windows 2003服务器的“wincred”*,没有其他答案帮助我。我必须使用cmdkey。

Cmdkey /list列出所有存储的凭证。 cmdkey /delete:Target删除名称为“Target”的凭据。

(*这里的“wincred”指的是git配置——全局凭据。助手wincred)

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

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

我找到了适合我的方法。当我给OP写注释时,我没有检查系统配置文件:

git config --system -l

显示了一个

credential.helper=!github --credentials

线。我用

git config --system --unset credential.helper

现在这些证书都被遗忘了。

Mac设备的答案:

应用程序/实用程序/密钥链Acccess

搜索git。并删除所需URL的git凭据。

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

git credential-manager clear

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

git config --global credential.helper
→ manager