将hexo放到github仓库上

完成了hexo的安装后, 我们只能在本地访问. 因此我们将它放到github上, 方便我们随时随地的用网址访问.

  1. 在Blog文件夹目录下输入: cnpm install --save hexo-deployer-git 用来安装git部署的插件
  2. 到GitHub上去建一个repository. 注意名字只能是" github账户名.github.io ".
  3. 设置_config.yml.  在Blog目录下找到_config.yml使用vscode或者sublime等编辑器打开.按照如下配置Deployment:

             

            4.回到命令行,输入: git config --global user.email "你的邮箱地址"

                                     git config --global user.name "你的github用户名" 来关联到账户

            5. 输入: hexo d 来将hexo部署到github. 中途会让你输入你的github用户名和密码. 输入就行.

            

           6.成功后就可以在浏览器输入github用户名.github.io来进入自己的博客了.

           7.大功告成!

原文地址:https://www.cnblogs.com/DSYR/p/10653282.html