遇到报错

hexo d 一直遇到报错,错误代码如下:

1
2
3
4
fatal: unable to access 'https://github.com/XXX/XXX.github.io.git/': Failed to connect to github.com port 443: Timed out
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Spawn failed
......

啰嗦

后面其实还有一串报错,但其实核心是 unable to accessFailed to connect to github.com port 443: Timed out,我一开始搞错了问题核心,一直在检索后面的报错信息,试了几种方法都一样报错,手机全局翻墙等等操作都不行。

改变检索思路后,终于在 git 出现 fatal: unable to access 问题找到答案。

作者开篇明义:“又到了一年一度的敏感时节”,嗯,老骑墙家了。

操作

  1. 先搞清楚自己的梯子在本地的代理地址及端口号,一般为127.0.0.1:xxxx
  2. 关闭各种国产杀毒、清理软件,启动梯子;
  3. 打开终端,依次输入:
    • git config --global http.proxy http://127.0.0.1:xxxx
    • git config --global https.proxy https://127.0.0.1:xxxx
  4. hexo d 即可部署;
  5. 最后取消代理,依次输入:
    • git config --global --unset http.proxy
    • git config --global --unset https.proxy

CHANGELOG

  • 20200609 Arlmy 创建、发布,thanks to 乌帮图