- 在github上新建仓库,仓库名必须严格为
用户名.github.io,并在setting里打开github page的设置 - 在
_config.yml加入:
yml
deploy:
type: git # 部署类型,如 git, heroku 等
repo: https://github.com/2008zhangtx-oss/2008zhangtx-oss.github.io.git
branch: main
- git下载插件:
bash
npm install hexo-deployer-git --save
- 终端上传:
bash
hexo clean; hexo g; hexo d
hexod # powershell配置
- 终端由于网络上传失败,要去配代理
bash
git config --global http.proxy http://127.0.0.1:17890
git config --global https.proxy http://127.0.0.1:17890
配完后可以取消:
bash
git config --global --unset http.proxy
git config --global --unset https.proxy