Hosting Your Site On Github

Github will host your site for free, which is incredibly nice of them. But for our purposes, there are some things to consider around how the repo is named:

Generally, given a repo named amazingrepo, if you push your Jekyll site onto a branch called gh-pages, the content will appear under (which is what you want for project-specific Jekyll sites); however there are some names that Github considers special and which are subject to different rules: if the Github repo is named like, or, within a Github organisation,, then Github will attempt to Jekylify whatever it finds in master and the content will appear under - that’s why this particular repo is named For the purposes of this document, I’m going to assume that you have a Github organisation for your band called bandname and your repo is called (and that you have control of the domain). Does that all make sense?

So anyway, presuming you have some committed content, go create a Github repo with the appropriate name, then bring that remote in:

git remote add origin

and push to it

git push origin master

then point your browser at and you should see either Hello from Jekyll once again, or a 404 with a message about It may take up to ten minutes until your page is available. In this case, go make some tea or something.


So you have some content hosted, for free, on Github, at But wouldn’t it be nice if it was at instead? Well that’s super-easy, too. You need a CNAME file at the root of the project (and note that you can only have the one CNAME, so you can’t have and, but it’s 2014 and it’s probably time we got past that):

echo > CNAME

Then you need to configure your DNS: until about two weeks ago I’d have told you to create an A record pointing the root domain at this Github IP address:, but then I discovered that CloudFlare have some advanced voodoo they call CNAME Flattening which means that a root domain can be properly CNAMEd without breaking all your MX records, and now I don’t know what to think. You should probably take a look, it’s amazing.

So after committing, pushing, and waiting the requisite DNS-propagation-time (which seems to getting shorter and shorter, maybe it’s just me, get off my lawn), your amazing site will be available at