hexo命令备忘录。
LinMu Lv3

hexo

hexo安装

1
npm install hexo-cli -g

hexo安装部署

1
npm install

安装hexo d的部署命令

1
npm install hexo-deployer-git --save

hexo一键三连。

1
hexo clean && hexo g && hexo d

git配置

1
2
git config --global user.name "wuxie136"
git config --global user.email "848129247@qq.com"
1
ssh-keygen -t rsa -C "848129247@qq.com"

上传命令

1
2
3
git add .
git commit –m "add branch"
git push

第二种方法

1
2
3
4
git add .
git commit -m '注释'
git branch -m main
git push -f origin main

连续回车,输入下面的看密钥

1
cat ~/.ssh/id_rsa.pub

测试是否连接

1
ssh -T git@github.com

上传到仓库

删除所有仓库链接

1
git remote rm origin

链接仓库

1
git remote add origin https://@github.com/wuxie136/blog136.git

忽悠一些不重要的文件。
创建.gitignore

1
2
3
4
5
6
7
.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/

部署到page

安装插件

1
npm install hexo-deployer-git --save

配置

1
2
3
4
deploy:
type: git
repo: https://github.com/YourgithubName/YourgithubName.github.io.git
branch: main

一键上传

1
2
3
4
git add .
git commit -m '注释'
git branch -m main
git push -f origin main

恢复hexo

1
git clone 仓库链接
1
2
npm install
npm install hexo-deployer-git --save
 评论