
报错:
$ git push
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.我是在 Windows10 下用 Git Bash 操作的其他平台也差不多。
重新生成 SSH Key。
$ ssh-keygen -t rsa -C GitHub绑定的邮箱$ ssh-keygen -t rsa -C GitHub绑定的邮箱
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/用户名/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/用户名/.ssh/id_rsa
Your public key has been saved in /c/Users/用户名/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:KI0NCK6lOpAvHOT9RPtpobmj3/08V4i+Bbg756Zh8+Q GitHub绑定的邮箱
The key's randomart image is:
+---[RSA 3072]----+
...
+----[SHA256]-----+然后找到这个位置,编辑这个文件,全选然后复制。
/c/Users/用户名/.ssh/id_rsa.pub然后打开 https://github.com/settings/keys

点 New SSH key ,把刚刚 id_rsa.pub 这个文件的内容粘贴进来,保存即可。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。