If you encounter this warning “Please make sure you have the correct access rights and the repository exists” in updating post to your Hexo blog , please follow these steps to solve the problem.
我昨晚遇到了这个问题,在更新文章到Hexo blog时,出现这个警告提示(翻查了Stack Overflow,Google,Github等平台后,终于找到比较合适的解决办法)
"Please make sure you have the correct access rights and the repository exists"
请按照下列步骤处理。
删除.ssh 下面的known_hosts 文件
删除github上的密钥,并重新生成和添加密钥
- 设置.ssh
创建 SSH 密匙,输入命令行
ssh-keygen -t rsa -C "GitHub 邮箱",
然后一路回车。
添加密匙:
先找到 id_rsa.pub 密钥文件
方法一:
打开终端输入
cat ~/.ssh/id_rsa.pub
就会显示出来,然后复制
方法二:
打开终端输入
open ~/.ssh
即可,打开文件夹,就可以找到id_rsa.pub文件了。
方法三:
在finder里按下cmd+shift+G,然后输入~/.ssh,确定,你就能看到你的文件了
用Xcode软件打开,并全文复制里面的内容。
登陆 GitHub ,进入 Settings 页面,选择左边栏的 SSH and GPG keys,点击 New SSH key。Title 随便取个名字,粘贴复制的 id_rsa.pub 内容到 Key 中,点击 Add SSH key 完成添加。
(遗憾的是,我按上面步骤重新生成和添加密钥2次,仍是提示相同错误)
4. 还是不成功,就是你家的网络问题。 建议换一个网络。 并且github是不需要翻墙的。
最后我是用第四步解决的,切换回国内的网络,在命令框中再提交部署博客文章
hexo g -d
来源参考: