title: hexo博客迁移步骤
date: 2023-07-19 16:54:00
tags: 博客搭建
categories: 生活
cover: https://gulimall-ayu.oss-cn-chengdu.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20230719171404.png
hexo博客迁移步骤:
- 旧平台安装git,添加.gitignore文件:
.DS_Store
Thumbs.db
db.json
.log
node_modules/
public/
.deploy/
- 使用git命令初始化仓库,上传源文件
#初始化仓库
git init
#添加当前位置所有文件
git add -A .
#然后提交文件推送
git commit -m "first commit"
git remote add origin https://gitee.com/ayu-elephant/myblog_origin.git
git push -u origin "master"
- 在新主机拉下代码,然后拉取theme主题代码
#新主机安装好hexo
npm install -g hexo-cli
#安装推送到github pages 的插件
npm install hexo-deployer-git --save
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
-
安装theme主题所需要的依赖
-
使用hexo命令部署博客
hexo clean
hexo generate
hexo server
hexo deploy
#写博客
hexo new xxx