Hexo博客部署命令

Salvio Blog@ixsay.com

使用Github托管的方式(git):

  • 首先配置 _config.yml 文件的相关内容
1
2
3
4
deploy:
type: git
repo: git@github.com:yourname/yourname.github.io.git # 注意这里
branch: main

清除缓存并部署

1
2
3
4
5
6
7
8
9
# 彻底删除部署文件夹(在 Hexo 根目录)
rm -rf .deploy_git

# 重新生成并部署
hexo clean
hexo g

#当使用本地推送静态文件的时候可以使用
hexo d

配置好用户和密钥并且在账户里粘贴SSH密钥的pub key

1
2
3
git config --global user.name "你的GitHub用户名"
git config --global user.email "你的注册邮箱"
ssh-keygen -t ed25519 -C "你的GitHub邮箱@example.com"

推送到上面

1
2
3
4
git add .
git commit -m "新文章"
git push origin main

  • Title: Hexo博客部署命令
  • Author: Salvio
  • Created at : 2026-01-19 00:00:00
  • Updated at : 2026-01-19 02:34:02
  • Link: https://blog.ixsay.com/post/d5b7ad2e.html
  • License: All Rights Reserved © Salvio
Comments
On this page
Hexo博客部署命令