git fetch upstream 报错 XXX Permission denied (publickey). fatal: Could not read from remote repository

出现这种错误一般是你的密钥错误,需要重新生成。

在windows的任意路径打开bash, 然后输入命令ssh-keygen -t rsa -C 邮箱地址
默认生成的密钥在/c/Users/用户名/.ssh

 

 

 

查看公钥

 

 

复制公钥进入github
进入仓库,点击Setting -> Deploy Keys -> Add new,粘贴公钥进入key输入框,勾选允许push,最后点击add key 按钮提交。

 

 

转载 https://blog.csdn.net/qq_41241310/article/details/116098655

 

posted @ 2021-10-20 09:54  hubb  阅读(377)  评论(0编辑  收藏  举报