I switched back to Jekyll from Posterous as I prefer having control over my data. Posterous’ auto formatting never really worked out well for me, and I like having the opportunity to customise pages as I see fit rather than having to conform to one particular format.

Anyhow, I’ve ended up with a share on Gandi and decided to take the opportunity to cut my repo hosting bills by self-hosting. At the time of writing, I’ve got a maxed out medium plan, which has become more of a problem as time has gone on - the next larger plan is by request, and will obviously cost more than the $22 I’m paying per month at the moment.

Looking around, the only self-hosting system I could find that had decent documentation was Gitolite.

Gitolite integrates with ssh, meaning there are no daemons running, so there is nothing to monitor or worry about. The installation instructions are thorough and correct, and I was able to get a running installation in under an hour. Additionally, it has permissions that run down to branch granularity, and it can be managed through git. Perfect.

To migrate my repos from Github to Gitolite, I firstly created the repos by updating my gitolite-admin repo (as per the instructions) and pushing those changes. Once I had the new remotes ready to go, I used the following script to automatically migrate:

#! /bin/bash

repos=( repo1 repo2 repo3 )

for repo in ${repos[@]}
do
echo $repo
git clone --bare git@github.com:MattHall/$repo
cd $repo.git
git push --mirror git@your-server.com:$repo.git
cd ..
rm -fr $repo.git
done

‘repos’ contain the names of the repos to be migrated. Note that collaborators, comments and anything outside of git itself will not be migrated.