Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 远程:无效的用户名或密码。致命:启用双因素身份验证后,身份验证失败_Git_Github_Two Factor Authentication_Multi Factor Authentication - Fatal编程技术网

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的“代码”按钮复制/粘贴值: