一:安装Node.js,git,并查看当前软件环境

二:配置SSH key
查看C:\Users\用户名.ssh下有无ssh文件夹,没有则创建
cd ~/. ssh
ssh-keygen -t rsa -C "邮件地址"

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

测试是否成功
ssh -T git@github.com

用户名 邮箱配置
git config --global user.name "pgzxc"// 你的github用户名,非昵称
git config --global user.email "xxx@qq.com"// 填写你的github注册邮箱

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

四:关联Github项目
git init
git remote add origin git@github.com:PGzxc/PGzxc.github.io.git

五:运行如下指令"npm install hexo --save"安装hexo
npm install hexo --save

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

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

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

九:hexo d 生成并上传
hexo d
十:添加备份
git add .
git commit -m 'modify'
git push origin hexo