【问题标题】:remote: Invalid username or password. fatal: Authentication failed, after two-factor authentication enabled远程:无效的用户名或密码。致命:启用双因素身份验证后身份验证失败
【发布时间】:2017-12-25 15:59:54
【问题描述】:
启用双重身份验证后,我在尝试git clone、git fetch 等时收到以下错误:
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/smartsendio/pickup-map.git/'
【问题讨论】:
标签:
git
github
two-factor-authentication
multi-factor-authentication
【解决方案1】:
启用双因素认证后,您将无法使用密码访问
您需要创建个人访问令牌
现在使用访问令牌而不是密码
【解决方案2】:
获取访问令牌后,您需要运行以下命令之一。然后,当您运行下一个“git push”时,它会询问您的用户名和密码,这是您的访问令牌。
MAC
git config --global credential.helper osxkeychain
Windows
git config --global credential.helper wincred