Hexo之部署github

最近开始学NodeJs,准备也在github上弄个一个Hexo博客练练过程中遇到一些问题总结一下。希望对遇到同样问题的同学能有个帮助少走一些弯路。

- 其实用windows或mac客户端直接去同步很顺利没遇到什么问题。主要是在使用Hexo deploy命令的时候。

我的配置文件deploy部分是这样写的

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:dangkei/dangkei.github.io

1.第一次遇到错误

Error: spawn git ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)

检查很多地方应该写的都对,百度了一下

添加环境变量:C:Program Files (x86)Gitin;C:Program Files (x86)Gitlibexecgit-core,这样就解决

2.接着又有新的错误提示

fatal: Not a git repository (or any of the parent directories): .git

提示说没有.git这样一个目录,解决办法如下:

git init

git init

就可以了!

原文地址:https://www.cnblogs.com/dangkei/p/4712870.html