cvs2svn is a tool that was originally developed to migrate CVS repositories to Subversion. The current development version of cvs2svn can also output the converted repository directly to git, a distributed version control system most famous for being used for Linux kernel development. When talking about converting from CVS to git, I will refer to the program as cvs2git, even though the project and the main executable are still called "cvs2svn".
Please note that conversion to git was added in release 2.1 of cvs2svn. Please make sure you are using cvs2svn release 2.1 or newer.
Most of the work of converting a repository from CVS to a more modern version control system is inferring the most likely history given the incomplete information that CVS records. cvs2svn has a long history of making sense of even the most convoluted CVS repositories, and cvs2git uses this same machinery. Therefore, cvs2git inherits the robustness and many of the features of cvs2svn. cvs2svn can convert just about every CVS repository we have ever seen, and includes a plethora of options for customizing your conversion. See the cvs2svn documentation for a summary of cvs2svn's features.
However, the git output of cvs2git is still rather new and rough around the edges. The main cvs2svn developer is not a git user, so help would be much appreciated! Some of these missing features would be pretty easy to program, and I'd be happy to help you get started.
But thanks to the excellent git-fast-import tool, the code needed to output to git is relatively straightforward, and it is believed that cvs2git can (cautiously) be used for production conversions.
cvs2git still has the following limitations:
It is not very intelligent about creating tags. When asked to create a tag, it unconditionally creates a tag fixup branch named TAG.FIXUP, then tags this branch. The TAG.FIXUP branch is cleared at the end of the conversion, but not deleted.
Some CVS tags can be created from a single parent, in which case the tag fixup branch would be superfluous. It would be possible to teach cvs2git to determine when single-source tags can be created, at a considerable cost in runtime and temporary workspace. Alternatively, it is possible to delete uninteresting branches after the conversion.
There is not a lot of documentation specific to cvs2git, but much of the cvs2svn documentation applies fairly straightforwardly to cvs2git. See the following sources:
This section outlines the steps needed to convert a CVS repository to git using cvs2git.
To Check out the current trunk version of cvs2svn, make sure that you have Subversion installed and then run:
svn co http://guest@cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk # The password is empty; i.e., just press return. cd cvs2svn-trunk make check # ...optional
Please note that the test suite includes tests that are marked "XFAIL" (expected failure); these are known and are not considered serious problems. In fact, the test for git output is marked XFAIL because the cvs2svn test suite doesn't know how to verify the contents of the git repository.
Initialize a git repository, and load the dump files using git-fast-import:
git-init cat cvs2svn-tmp/git-blob.dat | git-fast-import --export-marks=cvs2svn-tmp/git-marks.dat cat cvs2svn-tmp/git-dump.dat | git-fast-import --import-marks=cvs2svn-tmp/git-marks.dat
This can, of course, be shortened to:
git-init cat cvs2svn-tmp/git-blob.dat cvs2svn-tmp/git-dump.dat | git-fast-import
Feedback would be much appreciated, as I am a git newbie. Please send comments, bug reports, and patches to the cvs2svn mailing lists.