我有一个项目托管在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 remote set-url origin git@github.com:username/repository

其他回答

我做了:

$git pull origin master

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

Windows使用cmd-Greetings时出现问题

在Windows上使用cmd-Greetings不允许克隆私有存储库有一个问题。删除本文档中描述的cmd-greeting(关键字Command Processor):

已知的问题

我可以确认其他客户,如SourceTree, GitKraken, Tower和TortoiseGit也受到了这个问题的影响。

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

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

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

在github上禁用2因素身份验证对我有用。

我看到有一个删除的答案是这样说的,删除的原因是“没有回答这个问题”。如果它有效,那么我认为它回答了这个问题……

解决步骤:

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

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