Louis's Blog

How to manage your Hexo blog source code

Demo Repository

How to add a new branch to save hexo source code

1
2
3
4
5
6
7
cd /path/to/you/hexo
git init
git checkout -b sourcecode
git remote add https://github.com/shushanxingzhe/shushanxingzhe.github.io.git
git add .
git commit -m 'save source code'
git push origin sourcecode:sourcecode

Get source from Github and add new blog

Clone source

1
git clone -b sourcecode https://github.com/shushanxingzhe/shushanxingzhe.github.io.git github.io

Update dependency

1
2
cd github.io
npm update

Create New Blog

1
2
3
4
hexo new "New Blog Title Here"
#write you blog in the source/_posts directory
hexo s
#run server on local,and check it

Generate and Deploy

1
hexo d -g

Update source code to Github

1
2
3
git add .
git commit -m 'add new blog'
git push