部署过程中可能会出现错误

1
2
3
4
5
6
7
8
9
fatal: unable to access 'https://github.com/a956551943/a956551943.github.io/': Encountered end of file
FATAL {
err: Error: Spawn failed
at ChildProcess.<anonymous> (/usr/local/src/hexo/hanyubolg/node_modules/hexo-util/lib/spawn.js:51:21)
at ChildProcess.emit (events.js:376:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 128
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

解决方式一:

1
2
3
4
5
6
7
8
9
10
11
##进入站点根目录
cd /usr/local/src/hexo/hanyubolg/

##删除git提交内容文件夹
rm -rf .deploy_git/

##执行
git config --global core.autocrlf false

##最后
hexo clean && hexo g && hexo d

解决方式二:有可能是你的git repo配置地址不正确,可以将http方式变更为ssh方式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
##进入站点根目录
cd /usr/local/src/hexo/hanyubolg/

##删除git提交内容文件夹
vim _config.yml

##修改
deploy:

type: git

repo: https://github.com/yourname/yourname.github.io.git -> git@github.com:a956551943/weixiaohui.github.io.git

branch: master

##最后
hexo clean && hexo g && hexo d

解决方式三:不建议

1
2
3
4
5
6
7
8
##进入站点根目录
cd /usr/local/src/hexo/hanyubolg/

##进入depoly文件夹
cd .deploy_git/

##强制推送
git push -f