电脑重装系统后如何恢复Hexo博客

一: 安装nodejs , git

二: 配置SSH KEY

查看C:\Users\用户名.ssh下有无ssh文件夹,没有则创建

1
2
cd ~/. ssh
ssh-keygen -t rsa -C "邮件地址"

打开用户目录,找到.ssh\id_rsa.pub文件,记事本打开并复制里面的内容,打开你的github主页,进入个人设置 -> SSH and GPG keys -> New SSH key:

测试是否成功

1
ssh -T git@github.com

用户名 邮箱配置

1
2
3
git config --global user.name "pgzxc"// 你的github用户名,非昵称

git config --global user.email "xxx@qq.com"// 填写你的github注册邮箱

三: 进入到博客(pgzxc)文件夹删除node_modules public .git .deploy_git,

四: 关联Github项目

1
2
git init
git remote add origin git@github.com:xxxxxxxxx.github.io.git

五:运行如下指令”npm install –g hexo ”安装hexo

1
npm install –g hexo

六:运行如下指令安装项目依赖

1
npm install  

七:hexo -g 生成并本地预览

八:hexo -s 本地预览,在浏览器中输入http://localhost:4000/

九:hexo d 生成并上传

1
hexo d

十:添加备份

1
2
3
git add .
git commit -m 'modify'
git push origin hexo

转载至 https://blog.csdn.net/Calvin_zhou/article/details/85218157?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!