需要一个github帐号
https://github.com/nevereverretn
需要github特定仓库来存储个人博客网站
username.github.io的username一定与前面的owner一致
https://github.com/nevereverretn/nevereverretn.github.io
需要为github配置ssh key便于上传
ssh key可以防止其他人恶意部署文件到仓库,可以不配置
客户端生成ssh key
ssh-keygen -t rsa -C "youremail@example.com"
服务端设置ssh key
Settings -> SSH and GPG keys -> New SSH key,添加客户端生成的id_rsa.pub中的内容
安装插件
$ npm install hexo-deployer-git
如果git没有配置则全局配置
$ git config --global user.email "you@example.com" $ git config --global user.name "Your Name"
全局配置文件 ..\博客根目录 _config.yml
上传github设置
deploy: type: git repository: git@github.com:nevereverretn/nevereverretn.github.io.git branch: master
生成并上传
$ hexo d -g
国外网站,速度你懂的
来源:https://www.cnblogs.com/dailycode/p/12154500.html