从 Git 中删除凭据

从 Git 中删除凭据

问题描述:

我正在使用多个存储库,但最近我只是在我们的内部存储库工作,一切都很棒.

I'm working with several repositories, but lately I was just working in our internal one and all was great.

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

Today I had to commit and push code into other one, but I'm having some troubles.

$ 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

我无能为力,这会再次输入密码.

There is nothing I can do, that would bring the password entry again.

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

How can I reset the credentials on my system so Git will ask me for the password of that repository?

我试过了:

  • git config --global --unset core.askpass

为了取消密码

  • git config credential.helper 'cache --timeout=1'

为了避免凭据缓存...

in order to avoid credentials cache...

似乎没有任何效果;有人有更好的主意吗?

Nothing seems to work; does anyone have a better idea?

如果此问题出现在 Windows 机器上,请执行以下操作.

If this problem comes on a Windows machine, do the following.

  • 转到凭据管理器

  • Go to Credential Manager

  • 在德语中,它被称为:Anmeldeinformationsverwaltung
  • 在法语中,它被称为:Gestionnaire d'identification
  • 在波兰语中,它被称为:Menedżer poświadczeń
  • 在葡萄牙语中,它被称为:Gerenciador de Credenciais
  • 在俄语中,它被称为:Диспетчер учётных данных
  • 在西班牙语中,它被称为:Administrador de credenciales

转到 Windows 凭据

Go to Windows Credentials

删除通用凭据下的条目

尝试重新连接.这一次,它应该提示您输入正确的用户名和密码.

Try connecting again. This time, it should prompt you for the correct username and password.