我有一个项目托管在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上给出的说明和许多堆栈讨论的建议,但没有办法。你知道我可能做错了什么吗?


当前回答

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

更新旧的AD密码

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

其他回答

我也有同样的问题。我通过在客户端应用程序的repo设置中将远程分支的路径从https://github.com/YourName/RepoName更改为git@github.com:YourName/RepoName.git来解决这个问题。

试着再把它推到你的树枝上。这将再次询问您的用户名和密码,因此您可以输入更改后的密码。这样,您的新密码将再次存储在缓存中。

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

这就是答案。

设置github令牌:

https://github.com/settings/tokens

然后:

git remote set-url origin https://[token]@github.com/your_repository

解决步骤:

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

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