更换电脑了,hexo怎么同步博客配置呢?
快速完成同步配置
创建新仓库或者原仓库切换新分支
新仓库比较简单,现在以新分支为例。
- git clone https://github.com/你的github地址
- 本地创建新分支 hexo 并切换到该分支,git checkout -b hexo
- 推送分支并merge到远程分支hexo, 没有会自动创建,git push origin hexo:hexo
准备本地hexo配置文件
- 删除文件夹下除了.git文件之外的文件
- 把源目录下部分文件复制过来
_config.yml
package.json
scaffolds/
source/
themes/
.gitignore
- 添加文件到git
git add .
- 提交文件
git commit -m 个人博客资源文件
- 推送到远程
git push
现在就已经把配置备份完成了。其他电脑就可以使用了。
另外一台电脑使用
- git clone https://github.com/你的github地址
- 安装 hexo-cli
npm install hexo-cli -g
- 安装依赖
npm install
- 生成静态文件
hexo g
- 本地运行
hexo s
- 部署到 github page
hexo d