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


当前回答

我从bitbucket克隆应用程序时得到这个:

Cloning into 'YourAppName'...
Password for 'https://youruser id': 
remote: Invalid username or password

我解出来了。在这里,您需要为您的userid创建密码

点击你的个人资料和设置 然后创建应用密码选择你的名字密码将生成,粘贴该密码到终端

其他回答

这种情况发生的原因有很多。在我的案例中,没有一个解决方案有效。特别是,git拉origin master没有问我我的用户名和密码。

我在Windows上的github密码最近改了。我使用凭据管理器来管理我的密码。以下是对我有效的方法:

Confirm you are using the credential manager for git: git config --list … credential.helper=manager Run a new command prompt as administrator List all stored credential with cmdkey /list from C:\WINDOWS\system32> Remove the github target with cmdkey /delete:<target name>. In my case, the target name was github.<companyname>.com Open a new prompt and run a git command. You should get a popup asking for your usernmame and password. After providing the new credentials, it won't ask you for it again.

而不是git拉也尝试git拉origin master

我修改了密码,第一个命令报错:

$ git pull
remote: Invalid username or password.
fatal: Authentication failed for ...

git拉了origin master后,它询问密码,似乎更新了自己

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

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

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

试试这个:

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

Windows使用cmd-Greetings时出现问题

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

已知的问题

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