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


当前回答

这个解决方案对我很有效:

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

其他回答

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

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

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

我也有同样的问题

$ git clone https://github.com/sample-url.git
Cloning into 'Project'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/sample-url.git/'

我只是git init,然后git clone <clone-url>

git init
git clone https://github.com/your-clone-Url

这对我很管用。

试试这个:

# git remote set-url origin git@github.com:username/repository

这就是答案。

设置github令牌:

https://github.com/settings/tokens

然后:

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