0%

hexo deploy 命令卡住的奇怪问题

问题描述

hexo d命令部署的时候总是会卡住很久,反复尝试了几次后,每次都是control+C告终。

1
2
3
4
5
6
7
▶ hexo d
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
On branch master
nothing to commit, working directory clean
^CINFO Bye!

hexo d -debug查看日志发现信息一直在循环

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
▶ hexo deploy -debug
INFO Start processing
INFO Files loaded in 620 ms
INFO 0 files generated in 518 ms
INFO Start processing
INFO Files loaded in 468 ms
INFO 0 files generated in 363 ms
INFO Start processing
INFO Files loaded in 342 ms
...
INFO Start processing
INFO Files loaded in 274 ms
INFO 0 files generated in 381 ms
INFO Start processing
^CINFO Bye!

解决办法

首先检查_config.yml文件,看看deployment相关配置写对了没

1
2
3
4
5
6
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: [email protected]:mistwave/mistwave.github.io.git
branch: master

对照官方文档后,发现配置并没有错,推测是ssh的问题。
将repo改成https地址后,问题依旧存在。

找了一些类似问题的资料后,尝试了删除.deploy_git,更新git版本后,问题依然没有解决。

但是在删除.deploy_git后,发现总是在gitlog后面卡住,推测是git push的问题,尝试让git走代理,问题解决,令人哭笑不得。

git配置如下:

1
2
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

设置的意思是让http/https协议走代理,即Shadowsocks的本地代理。

参考文章

  1. hexo repo上一个类似issues
  2. hexo在github部署卡住的奇怪问题
  3. 为终端设置Shadowsocks代理
  4. 用shadowsocks加速git clone