Synchronize between multiple hexo bases

your.github.io setup

  1. Initial your.github.io with hexo deployment
  2. Create a branch named “hexo” from your.github.io master branch
  3. Set “hexo” as your default branch of your.github.io

your new hexo bases setup

  1. Git clone git@github.com:your/your.github.io.git
  2. Change dir to your cloned “hexo”, install packages for hexo
    1
    2
    cd your.github.io
    npm install
  3. Make sure deploy branch in _config.yml is master

Synchronize

  1. git clone for inintial hexo base
  2. Install theme if you are not using “landscape”

    themes/next example

  3. On your up to date hexo base: Copy your “themes/next/_config.yml” to your “hexo” branch root
    1
    2
    3
    4
    cp themes/next/_config.yml next-config.yml
    git add .
    git commit -m "sync theme config"
    git push
  4. On your new hexo base: git pull to get the latest theme’s config
    1
    2
    git pull
    cp next-config.yml themes/next/_config.yml

    Writing

  5. hexo new post to start writing
  6. after writing commit source to your.github.io “hexo” branch
    1
    2
    3
    git add .
    git commit
    git push
  7. hexo g -d to deploy to your.github.io master branch

Reference from:

使用hexo,如果换了电脑怎么更新博客?