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?
You can use git cvsimport. It requires cvsps to be installed, but you need to install 2.x, as 3.x is not incompatible anymore.
Then import CVS repository on empty git. Sample usage:
git cvsimport -C RepoName -r cvs -o master -k -v -d:pserver:anonymous@reponame.cvs.sourceforge.net:/cvsroot/path ModuleName
On OSX you install cvsps-2.1 in the following way (having brew):
brew tap homebrew/versions
brew install cvsps2
brew link cvsps2
You can also use cvs2git tool which can convert a CVS repository to git. However you need to have access to a CVSROOT directory.
Check cvs2git documentation for installation steps.
Example usage:
cvs2git --blobfile=git-blob.dat --dumpfile=git-dump.dat --username=cvs2git /path/to/cvs/repo
This would create two output files in git fast-import format. The names of these files are specified by your options file or command-line arguments. In the example, these files are named cvs2git-tmp/git-blob.dat and cvs2git-tmp/git-dump.dat.
These files can be imported into empty git repository by:
cat git-blob.dat git-dump.dat | git fast-import
Then delete the TAG.FIXUP branch and run gitk --all to view the results of the conversion.
Check for more, by running: cvs2git --help.