Resounding Questions

There's so Much to Know

Tracking Github Upstream - Keeping Octopress Updated

When every new year rolls around, I promise myself this will be the year that I finally become a regular blogger. Instead, I end up with a dribble of posts around the start and end of each year that eventually peter out to nothing.

Well..it’s that time again! And since it’s that time again, hacking instincts to the fore – needless procrastination caused by updating my blogging set up. This site is statically generated – that is to say, it’s all HTML, CSS and Javascript, with no CMS and no database. I use Octopress for this, and since the software only runs on my desktop I at least don’t have to worry about updating my server.

Octopress is a project stored on Github, and my blog is also stored in git. So far so fine, I should just be able to do some tracking of upstream remotes and…

1
2
$ git remote
origin

Oh great. I always forget to set upstream properly. So, here’s how to do that (adapted from this StackOverflow article):

1
2
3
4
$ git remote add upstream https://github.com/imathis/octopress
$ git remote
origin
upstream

Not that there’s anything special about the upstream name, but it’s a useful convention to follow. This adds a new remote repository to track against my existing repo. Since that remote is the repository I originally forked from, we have a shared history. This means I’ll be able to pull in the latest stable changes. So, let’s do that

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ git pull upstream master
remote: Counting objects: 601, done.
remote: Compressing objects: 100% (348/348), done.
remote: Total 601 (delta 269), reused 512 (delta 211)
Receiving objects: 100% (601/601), 204.08 KiB | 280.00 KiB/s, done.
Resolving deltas: 100% (269/269), done.
From https://github.com/imathis/octopress
 * branch            master     -> FETCH_HEAD
 Removing source/images/icon-sdc231d6676.png
 Auto-merging _config.yml
 CONFLICT (content): Merge conflict in _config.yml
 Auto-merging Rakefile
 Auto-merging Gemfile.lock
 CONFLICT (content): Merge conflict in Gemfile.lock
 Removing .themes/classic/source/javascripts/libs/ender.js
 Removing .themes/classic/source/javascripts/ender.js
 Removing .themes/classic/source/_includes/asides/twitter.html
 Removing .themes/classic/sass/partials/sidebar/_twitter.scss
 Automatic merge failed; fix conflicts and then commit the result.

OK, good, solid progess.

After resolving the conflicts and a bundle install, I’ve got a freshly minted master version to work with. Nice.

Note on specifics

  1. As of this post (January 2014) Octopress maintains a stable release on master.
  2. Brandon Mathis (Octopress maintainer) is currently working on an Octopress 3.0, which will have entirely new themeing. But since I already have an Octopress blog, I’m not going to worry about that right now.