将hexo上传到GitHub
方法一:使用hexo插件自动上传
创建GitHub仓库
首先,我们创建一个新的GitHub仓库
修改config.yml
打开站点的配置文件,将默认的http://yoursite.com
替换为您自己的网址
将配置文件最下方的deploy替换为
deploy:
type: git
repo: #您的GitHub仓库地址
branch: master
安装插件
npm install hexo-deployer-git --save
部署
hexo g && hexo d
接着您便可以访问您的网站来查看hexo博客
方法二:手动上传整个文件夹
命令行输入
git init
在新产生的.gitignore
中填写以下内容
node_modules/
public/
db.json
debug.log
添加远端仓库
git remote add origin https://github.com/yourname/yourrepo.git
推送
git push -u origin master
推荐文章