Reproducing the Problem

Reproducing this problem is easy. It’s most likely a network issue: just turn off your proxy tool, accelerator, or similar network-optimization software, then make sure the pushing device’s network is within mainland China, and chances are you’ll reproduce it…

Solving the Problem

These problems are usually caused by an unstable network environment, so start with the network. First, use a network proxy tool to relay the current device’s network environment—relay the resources Hexo pushes to another device, and send them to GitHub from that device.

0x0001

I personally use Clash as the proxy medium; check the proxy port.

Note down this port 7890. If you’re using v2ray proxy, the default port is usually 1080.

0x0002

Use the following command in the terminal to change git's global proxy settings

git config --global http.proxy http://127.0.0.1:7890

--global means global, 127.0.0.1 means the local machine, and 7890 refers to the proxy port you noted down earlier.

0x0003

Change the push address to an https address. You can go to your GitHub repository, click “Code>HTTPS” and copy it.

Then edit the _config.yml configuration file in your Hexo site’s root directory to change the push address.

If you were already using an https address rather than ssh, you can skip this step.

0x0004

Then it’s the Hexo trio! Check whether the push succeeded.

hexo cl && hexo g && hexo d

Don’t forget to enable your proxy tool.