Making a git mirror of Jikes RVM

October 4th, 2008  |  Tags: , , , ,

I’ve been a longtime subversion user but have been switching some projects over to git lately. One major disadvantage that svn presented for my dissertation work arose because I was often interested in extending someone else’s code (like jikesrvm or soot): I’d want version control on my changes (and the opportunity to make branches, etc.), but I’d also want an easy way to track changes to the official project. Subversion does not, by itself, provide an easy way to do this.

Git makes it pretty easy to track changes to a repository that you don’t control while providing version control for local modifications and easy branching and merging. However, importing a large repository from svn can a really long time (almost a whole day for a medium-sized repository), and some svn servers (sourceforge in particular) are a bit flaky, which can lead to local repository corruption.

If you’re interested in having a local git mirror of a subversion repository, and the remote repository supports rsync, then it will be much faster to mirror the repository locally (via rsync) and then convert your local svn repository to a git repository. Then you have a local git repository, and you can just rsync and git svn fetch when it’s time to update from the original repository.

Here’s a quick snippet to show how it’s done for JikesRVM.

On another note, I couldn’t be more pleased with the GitHub hosting service! I’ve posted some code snippets on “gist,” their version-controlled pastebin. I am also using github to house some more substantial code — although the only public repository there right now is my LaTeX template for Wisconsin dissertations. Hopefully, I will be able to share more code in the future.