Recreating a local Octopress repository

To recreate the local directory structure of an existing Octopress blog, follow these instructions.

Clone your blog to the new machine

First you need to clone the source branch to the local octopress folder.

1
$ git clone -b source git@github.com:username/username.github.com.git octopress

Then clone the master branch to the _deploy subfolder.

1
2
$ cd octopress
$ git clone git@github.com:username/username.github.com.git _deploy

Then run the rake installation to configure everything

1
2
3
4
$ gem install bundler
$ rbenv rehash
$ bundle install
$ rake setup_github_pages

Pushing changes from two different machines

If you want to blog from more than one computer, you need to make sure that you push everything before switching computers. From the first machine do the following whenever you’ve made changes:

1
2
3
4
5
$ rake generate
$ git add .
$ git commit -am "Some comment here." 
$ git push origin source  # update the remote source branch 
$ rake deploy             # update the remote master branch

Then on the other machine, you need to pull those changes.

1
2
3
4
$ cd octopress
$ git pull origin source  # update the local source branch
$ cd ./_deploy
$ git pull origin master  # update the local master branch

Comments