CVS to git migration

I still use CVS for Source Code Management (SCM) of a few projects (including this web site). The use of CVS originally stemmed from FreeBSD including CVS in base. That inclusion stopped a number of years ago, but I still used CVS from ports, because inertia...

Now, with the new Protectli Debian-based server, maybe it was time to move to something more modern i.e. git. Was there a suitable tool to migrate the CVS repositories, keeping all the historical commits?

Yes, there are a number of possibilities, but they are relatively old, as I suppose nearly everyone else has already moved off CVS. My first stab at migration was based on Eric Raymond's cvs-fast-export. And this worked very well!

cvs-fast-export has a number of dependencies that a provided script, buildprep, will install for you if on one of the supported OSes. On Debian, because it has apt, this script works fine.

The pre-requisites are:

A number of these were already installed on ash. Those that are only required for cvs-fast-export I'll delete later.

The following incantation was sufficient to migrate to git (bt is an example):

  $ cd /rep/cvsroot/bt
  $ find . | ~/dev/cvs-dast-export-master/cvs-fast-export >/tmp/
  $ cd ~/dev
  $ mkdir btgit
  $ cd btgit
  $ git init
  $ cat /tmp/ | git fast-import
  $ git reset --head master

This creates (as far as I can tell) at least three branches:

master and main are identical, so master can be deleted.

So, I've joined the cool kids, just a few(?) years late.