I finally decided to sign up for github. What prompted me was the desire to upgrade this blog to WordPress 3.0, from its current WordPress MU 1.5.1. I find that it is much easier to pull in an upstream branch and make my own changes on top if I use git as opposed to subversion. And since importing the wordpress svn repository into git was an overnight process, I decided to share the resulting git repo on github, so others can speed up their own wordpress git import should they ever want to do that. And that is how my first ever github repo became a repo that is just tracking the progress of wordpress. Good enough for a start.

I did not use the default git-svn configuration because it was lacking a few feature I like.

First, my local repo is not using the default git-svn branch to tag mapping. Instead, I configure git-svn to prefix all remote branches with “svn” so they are easy to follow. The “trunk” I also push into a branch named trunk, to make it easy to follow on github. I also configured the github remote repo to simply push all remote svn branches to similarly named proper branches. Tags in the subversion repo also become tags in the local repo. So, the flow is: wordpress subversion -> refs/remotes/svn @ local -> refs/heads @ github. And the commands I have to run to update github are just “git svn fetch” followed by “git push github” and eventually “git push github –tags”.

The other cool thing is that with this configuration I can do the syncing with a bare git repo.

And here are the relevant parts from the config of my local git repo:

[svn-remote "svn"]
        url = http://core.svn.wordpress.org
        fetch = trunk:refs/remotes/svn/trunk
        branches = branches/*:refs/remotes/svn/*
        tags = tags/*:refs/tags/*

[remote "github"]
        url = git://github.com/chutzimir/wordpress-svn
        pushUrl = git@github.com:chutzimir/wordpress-svn
        fetch = refs/heads/*:refs/remotes/svn/*
        push = refs/remotes/svn/*:refs/heads/*

Note that I also do not prefix the fetch line of github with “+” because I do not want the two remote repos – subversion and github – to accidentally overwrite the local tracking branches.