migrating from cvs to git

Sun, Aug 8, 2010

Recently I decided to move Guanxi from Sourceforge to GitHub as I like the social side of coding and being able to manage collaborations and committers better. I first had a go using git-cvsimport but it failed on the Engine, so I ended up taking the plunge and going with cvs2git. There’s a fair amount of setup required, so here are the steps I took to get Guanxi onto GitHub.

Local copy of CVSROOT

The first thing I needed was a local copy of the Guanxi CVS repository as cvs2git only works on local repos:

gdbm

The next thing I needed was gdbm or this error appeared when I tried to run cvs2git:

Download gdbm from here.

I needed those last copies as the install doesn’t work on OS X. Sometimes you can get it to work by changing BINOWN and BINGRP in Makefile but it didn’t this time.

Python

Next up is installing Python while getting it to make use of gdbm. Download Python from here.

Once it’s finished building, you’ll see a bunch of libraries it couldn’t find but gdbm shouldn’t be one of them.

cvs2git

I got hold of cvs2git directly from the svn repo:

I then made a copy of the options file:

and changed these variables:

and then ran it to convert the history for the Guanxi Service Provider Engine module:

Preparing the source code for migration

The first thing you realise is cvs2git only works on the history of the source. If you don’t init the new git repo with the original source you’ll end up with nothing but history files. So I started with the Engine module.

Populating the new git history

Although nothing has been committed by a “git commit”, doing “git status” at this point shouldn’t show anything needing to be committed as the entire history converted from CVS takes care of that.

All I had to do then was create a GitHub repository and push the Engine to it:

I didn’t bother with “git push –tags” as they show as Downloads in the repo, which isn’t what I wanted. However, “git push –all origin” pushes all the branches, which is what I did want as they contain all the release code.

comments powered by Disqus