问题背景:
在git bash中使用hexo g -d命令进行文章发布

详细错误信息:

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Connection reset by 13.250.177.223 port 22
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists. at ChildProcess.<anonymous> (E:\Hexo\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at ChildProcess.cp.emit (E:\Hexo\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:915:16)
at Socket.stream.socket.on (internal/child_process.js:336:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:561:12)

错误原因是因为ssh key有问题,连接不上服务器。

于是我参考如下链接,一步一步操作,最终解决了这个问题:
git遇到的问题之“Please make sure you have the correct access rights and the repository exists.”

虽然已经有了问题的解决答案,但是我觉得还是需要列举一下相关步骤,梳理一下:

1.重新在git设置一下身份的名字和邮箱

git config --global user.name "yourname"

git config --global user.email "your@email.com"

这里的yourname必须与github的用户名一致

这里your@email.com必须与github登录邮箱一致

2.删除.ssh文件夹下的known_hosts文件(该文件主要作用是域名解析)

3.ssh-keygen -t rsa -C “your@email.com(填写github对应的邮箱)”

一路回车即可,无需输入

4.进入github设置界面

新增SSH key将id_rsa.pub内容添加到如图中的Key上(title可任意命名):

5.最后完美解决这个问题

最新文章

  1. cordova iOS blank iframe iphone iframe 白屏 ios iframe 白屏
  2. [SDK2.2]Windows Azure Cloud Service (35) 使用VS2013发布Azure Cloud Service
  3. Eclipse C++开发环境配置(很简洁)
  4. 表单 - Form - EasyUI提供的表单异步提交
  5. ISO13485给企业带来的益处
  6. 【学习笔记】【C语言】关键字
  7. 在C#调用C++的DLL方法(一)生成非托管dll
  8. 201521123048 《Java程序设计》第3周学习总结
  9. Flask Session 使用和源码分析 —— (6)
  10. windows上python的安装
  11. Mac+Apache+PHP 安装 Xdebug 方法
  12. android 短信拦截
  13. [USACO12DEC]逃跑的BarnRunning Away From…
  14. JAVA中int转string及String.valueOf()的使用
  15. HDU 6231
  16. (连通图 缩点 强联通分支)Popular Cows -- poj --2186
  17. python 内存问题(glibc库的malloc相关)
  18. [BZOJ2946][Poi2000]公共串解题报告|后缀自动机
  19. 微信公众号开发 但是服务端仅仅接收到了 p1 p2 没有接收到p3
  20. 加深理解HTTP请求---网络基础TCP/IP

热门文章

  1. hadoop细节 -&gt; 持续更新
  2. js获取列表多条数据(接口)
  3. nodeJS从入门到进阶一(基础部分)
  4. Django:RestFramework之-------渲染器
  5. php正则表达式中preg_match_all函数的详解
  6. 最佳移动端h5自适应rem适配方案
  7. Scala快速入门 - 基础语法篇
  8. 基于gtk的imshow:用stb_image读取图像并用gtk显示
  9. docker复制文件到宿主机
  10. Spark 基础 —— 创建 DataFrame 的三种方式