启用双因素身份验证后,尝试 , 等时出现以下git clone
错误git fetch
:
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/smartsendio/pickup-map.git/'
启用双因素身份验证后,尝试 , 等时出现以下git clone
错误git fetch
:
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/smartsendio/pickup-map.git/'
获取访问令牌后,您需要运行以下命令之一。然后,当您运行下一个“git push”时,它会询问您的用户名和密码,这是您的访问令牌。
MAC git config --global credential.helper osxkeychain
WINDOWS git config --global credential.helper wincred
一种解决方案是使用个人访问令牌,如@surendra 所述;另一种解决方案是使用受密码保护的 SSH 密钥:
请按照此处的说明进行操作:
...但是关于使用 ssh 进行身份验证,我想说明的要点是关于 git 配置文件.git/config
(在您的存储库中)。您可能会看到类似于以下内容的行:
[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 存储库的代码按钮中复制/粘贴值: