Git 远程:无效的用户名或密码。致命:启用双因素身份验证后,身份验证失败
启用了双因素身份验证后,我在尝试Git 远程:无效的用户名或密码。致命:启用双因素身份验证后,身份验证失败,git,github,two-factor-authentication,multi-factor-authentication,Git,Github,Two Factor Authentication,Multi Factor Authentication,启用了双因素身份验证后,我在尝试git clone、git fetch等时出现以下错误: remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/smartsendio/pickup-map.git/' 启用双因素身份验证后,您无法使用密码进行访问 您需要创建个人访问令牌 现在使用访问令牌而不是密码 获取访问令牌后,您需要运行以下命令之一。然后,当您运行下一个“gi
git clone
、git fetch
等时出现以下错误:
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/smartsendio/pickup-map.git/'
启用双因素身份验证后,您无法使用密码进行访问 您需要创建个人访问令牌 现在使用访问令牌而不是密码
获取访问令牌后,您需要运行以下命令之一。然后,当您运行下一个“git push”时,它会询问您的用户名和密码,这是您的访问令牌 苹果 git config--全局凭证.helper osxkeychain 窗户 git config--global credential.helper wincred一个解决方案是使用个人访问令牌,正如@surendra所描述的;另一种解决方案是使用受密码保护的SSH密钥: 请按照此处的说明操作: …但是关于使用ssh进行身份验证,我想说的要点是关于git配置文件,
.git/config
(在您的repo中)。您可能会看到类似于以下内容的行:
[remote "origin"]
url = https://github.com/smartsendio/pickup-map.git
fetch = +refs/heads/*:refs/remotes/origin/*
注意上面的url
行。。。必须将其更改为:
url = git@github.com:smartsendio/pickup-map.git
…您可以从GitHub repo的“代码”按钮复制/粘贴值: