我有一个项目托管在GitHub上。我失败时,试图推动我的修改在主人。我总是得到以下错误消息

Password for 'https://git@github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://git@github.com/eurydyce/MDANSE.git/'

但是,设置我的ssh密钥到github似乎没问题。实际上,当我执行ssh -T git@github.com时,我得到

Hi eurydyce! You've successfully authenticated, but GitHub does not provide shell access.

这似乎表明,一切都是OK从这一边(eurydyce是我的github用户名)。我严格按照github上给出的说明和许多堆栈讨论的建议,但没有办法。你知道我可能做错了什么吗?


当前回答

我已经成功地使用以下命令。

git config --unset-all credential.helper
git config --global --unset-all credential.helper
git config --system --unset-all credential.helper

试着告诉我这些对你是否有效。

其他回答

您可能会得到这个错误,因为您已经更新了密码。所以在终端上,首先确保你从钥匙链中清除你的GitHub凭证,然后将你的更改推到你的回购,终端将要求你的用户名和密码。

我经常遇到这个问题。 确保你设置了git——config user.name ""而不是你的真实姓名,我已经做过几次了。

由于密码错误,有时会发生这种问题。请检查您是否连接了AD密码(Active Directory密码),并且您最近更改了AD密码,但仍在使用旧密码尝试git命令。

更新旧的AD密码

Control Panel > Credential Manager > Windows Credential > change github password with my new AD password

解决步骤:

控制面板 证书管理器 单击Windows凭证 在Generic Credential部分,将有git url,更新用户名和密码 重新启动Git Bash并尝试克隆

注意: 如果你在通用凭据部分没有找到git url,请遵循下面的答案 https://stackoverflow.com/a/55858690/7372432

控制面板 证书管理器 寻找选项web凭据和windows凭据 在任何一个你会发现github凭证修复它与正确的凭证 打开新的git bash实例,你应该能够执行你的git命令。

这为我工作,我能够拉和推到我的远程回购。