每当我在本地驱动器(仍在使用https )上输入一些旧的克隆存储库时,就不再允许使用git push:
Username for 'https://github.com': MYUSERNAME
Password for 'https://MYUSERNAME@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/USER/REPO.git/'
.git/config
不受后台的影响,因此此文件中的url
设置为https://github.com ...
。现在我可以更改.git/config
中的url以使用SSH键:url = git@github...
。但是我想在这里继续使用https。我怎么能这么做?
发布于 2016-10-07 07:08:37
结果发现,这与所添加的SSH密钥无关。我还添加了双因素认证(2FA),这也是我开始出现问题的原因。
解决方案是创建一个令牌,在通过HTTPS:https://help.github.com/articles/https-cloning-errors#provide-access-token-if-2fa-enabled管理存储库时使用该令牌而不是密码。
发布于 2016-07-05 11:16:33
SSH键用于SSH连接,而不是HTTP(S)。
如果您的存储库已经使用HTTP设置了远程存储库,则可以使用命令git remote set-url origin git@github.com:USER/REPO.git
轻松地更改它
https://stackoverflow.com/questions/38201934
复制相似问题