I intend to switch over from CVS to Git.
In the case of SVN, there seems to be cvs2svn
. Is there a similar tool to easily migrate from CVS to Git?
In addition to provided answers, here's a guide on how to convert cvs to git using cvs2git tool. Here, modulename is a name of CVS directory you want to import.
Prerequisites
cvs2svn
package (which includes cvs2git command) should be already installed.
Update: steps 1 and 2 are not fully correct - before attempting, read the comment below by mhagger, the maintainer of cvs2git
checkout modulename
cvs -d URL co -P modulename
create an empty CVSROOT needed by cvs2git
mkdir modulename/CVSROOT
download an example of cvs2git.options at http://cvs2svn.tigris.org/svn/cvs2svn/trunk/cvs2git-example.options (user "guest" with no password)
edit cvs2git.options file. Replace r'test-data/main-cvsrepos' with 'modulename'. Edit authors transforms.
# edit this
run_options.set_project( r'modulename',
# and this
author_transforms={
'jrandom' : ('J. Random', 'jrandom@example.com'),
'mhagger' : 'Michael Haggerty <mhagger@alum.mit.edu>',
run cvs2git to create git temp files
cvs2git --options=cvs2git.options --fallback-encoding utf-8
create git repository
mkdir gitrepo && cd gitrepo && git init .
import from git temp files created by cvs2git
cat ../cvs2git-tmp/git-{blob,dump}.dat | git fast-import
checkout working copy
git reset --hard
I've not tried this myself, but friends have reported good success converting first from CVS to SVN, and then from SVN to Git. It seems that the tools to do those respective transitions have been more thoroughly shaken out than a direct CVS to Git transition.
You can add fromcvs to the list. It converts well and is extremely fast and also incremental. It does not do sticky tags, only branches, however.
The only tool that has incremental import seems to be git-cvsimport. If you want to convert (migrate) from CVS to Git, the best solution for now seems to be mentioned above cvs2git mode of cvs2svn.
See also Interfaces Frontends And Tools page on Git wiki, section about interaction with other revision control systems.
An alternative might be to use git cvsimport *
If anyone still has the misfortune of using CVS, you could try "crap" : https://github.com/rcls/crap It's fast (as far as accessing CVS can be fast), supports the messes that you find in cvs repos, and incremental.