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

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

$ 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'

为了避免凭证缓存…

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


当前回答

至少在Windows上,git remote show [remote-name]可以工作。

git remote show origin

其他回答

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

git config --system -l

显示了一个

credential.helper=!github --credentials

线。我用

git config --system --unset credential.helper

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

当您在同一台机器上使用多个Git帐户时,将出现此错误。

如果你使用的是macOS,那么你可以删除github.com保存的凭据。

请按照以下步骤删除github.com凭据。

开放钥匙串访问 找到github 选择github.com并右键单击它 删除“github.com” 再次尝试推或拉git,它将要求凭据。 为存储库帐户输入有效凭据。 完成

尝试使用下面的命令。

git credential-manager

在这里,您可以获得各种选项来管理您的凭证(检查下面的屏幕)。

或者你甚至可以直接尝试这个命令:

git credential-manager uninstall

这将在每次服务器交互请求时再次提示输入密码。

在我的Win 10上,找不到Windows凭据管理器和。git-credentials。 有效的方法是打开Git GUI并推送代码。然后它请求凭据,这也更新了我Git Bash缓存的密码。

如果此问题发生在Windows计算机上,请执行以下操作。

Go to Credential Manager in German, it is called: Anmeldeinformationsverwaltung in French, it is called: Gestionnaire d'identification in Polish, it is called: Menedżer poświadczeń in Portuguese, it is called: Gerenciador de Credenciais in Russian, it is called: Диспетчер учётных данных in Spanish, it is called: Administrador de credenciales in Norwegian, it is called: Legitimasjonsbehandling in Czech, it is called: Správce pověření in Dutch, it is called: Referentiebeheer Go to Windows Credentials Delete the entries under Generic Credentials Try connecting again. This time, it should prompt you for the correct username and password.