Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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 - Fatal编程技术网

Git 远程:无效的用户名或密码。致命:的身份验证失败

Git 远程:无效的用户名或密码。致命:的身份验证失败,git,github,Git,Github,我使用Git for Windows。我创建了SSH密钥,并将其添加到GitHub设置的密钥列表中。现在我尝试使用它,但我得到了错误: $ git push origin master Username for 'https://github.com': Andrey-Bushman Password for 'https://Andrey-Bushman@github.com': remote: Invalid username or password. fatal: Authenticati

我使用Git for Windows。我创建了SSH密钥,并将其添加到GitHub设置的密钥列表中。现在我尝试使用它,但我得到了错误:

$ git push origin master
Username for 'https://github.com': Andrey-Bushman
Password for 'https://Andrey-Bushman@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/Andrey-Bushman/sandbox.git/

如何修复它?

首先确保通过执行以下命令成功创建ssh密钥:

$ ssh -T git@github.com
应该打印出来
“嗨,Andrey Bushman!您已成功通过身份验证,但GitHub不提供shell访问。”

如果没有,请参阅

完成后,请执行以下步骤:

  • 使用ssh协议将repo克隆为:

    git@github.com:/.git

    就你而言:

    git@github.com:Andrey Bushman/.git

  • 将您的更改提交到回购协议

  • 然后,
    git推送原点

    就你而言:

    git推送原始主机


  • 你应该使用用户名
    git
    。你能写下你的
    git-remote-v
    结果吗?>如果它打印“嗨,安德烈·布什曼!你已经成功通过身份验证,但GitHub不提供shell访问。”是的,它会打印出来。>git@github.com:Andrey Bushman/.git我必须在哪里使用它?不,首先,您必须使用ssh克隆repo,然后使用origin name推送它。