我有一个项目托管在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 user.name ""而不是你的真实姓名,我已经做过几次了。

其他回答

这就是答案。

设置github令牌:

https://github.com/settings/tokens

然后:

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

在这种情况下,如果你得到这个错误信息:

使用github创业 使用凭据。在git配置中,Helper =wincred 使用您最近更改的Windows凭据

然后看看这个答案: https://stackoverflow.com/a/39608906/521257

Windows将凭据存储在凭据管理器中,清除或更新它。

我也有同样的问题

$ 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 pull origin master

然后它要求[用户名]和[密码],现在似乎工作正常。