我使用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/
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
首先确保通过执行以下命令成功创建 ssh 密钥:
$ ssh -T git@github.com
Run Code Online (Sandbox Code Playgroud)
它应该打印
"Hi Andrey-Bushman! You've successfully authenticated, but GitHub does notprovide shell access."
如果没有,请参阅SSH 访问 Git。
完成后,请按照以下步骤操作:
使用 ssh 协议克隆存储库:
git@github.com:<github-username>/<repo>.git
在你的情况下:
git@github.com:Andrey-Bushman/<repo>.git
将您的更改提交到存储库。
然后,git push origin <branch-name>
在你的情况下:
git push origin master
| 归档时间: |
|
| 查看次数: |
9028 次 |
| 最近记录: |