我刚刚启用了双因素认证(我想不出我所做的其他更改),然后git要求我输入用户名和密码。我提供了两个信息,但是都被认为是"错误的"。我尝试了这里的许多解决方案:Git push requires username and password,但都没有起作用。特别是在从https切换到ssh时,ssh密钥会出现
Permission denied (publickey). fatal: Could not read from remote repository.
$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Username for 'https://github.com': **********
Password for 'https://mlbileschi@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/mlbileschi/scala.git/'
有什么建议吗?
gh
),问题就会消失。首先,按照项目README中的说明下载GH CLI,然后按照手册进行身份验证。按照终端中的说明操作,当GH CLI完成身份验证后,您就不需要再输入密码来进行git push
操作了。 - truth