github博客换机无缝迁移教程
迁移参考(这个迁移教程是不全的):
https://blog.csdn.net/qq_43698421/article/details/120407042?fromshare=blogdetail&sharetype=blogdetail&sharerId=120407042&sharerefer=PC&sharesource=a1150568956&sharefrom=from_link
搭建参考:
https://yangcheneee.github.io/categories/博客/
旧电脑如下操作:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| bash git clone $原仓库 cd到目录下 git checkout -b hexo git push origin hexo:hexo
_config.yml package.json scaffolds/ source/ themes/ .gitignore
git add . git commit -m '提交仓库所需资源' git push origin hexo:hexo
|
同时,假如安装了butterfly主题或其他主题,注意保留其下的_config.yml
,之后会用到。 同时注意在main分支的public
目录下的资源(图片),如果后续发现没有这些东西,也要手动迁移一发到新电脑上。
新电脑如下操作:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| git clone $原仓库 cd到目录下 git checkout hexo npm install hexo-cli -g npm install
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
npm install hexo-renderer-pug hexo-renderer-stylus --save npm install hexo-generator-search --save
hexo g hexo s
|