Search code examples
gitversion-controlcvs

Migrate from CVS to Git without losing history


I need to know if there is a way to migrate my code from CVS source control to Git?

If yes, what about my history of commits?


Solution

  • I've not personally done a conversion from CVS to Git, but I believe Eric Raymond's cvs-fast-export is the tool to use. He has the man page posted here. cvsps is another tool maintained by Eric, but it has recently been deprecated in favor of cvs-fast-export. cvs2git is another tool which is built on some of the same machinery as cvs2svn. The latter was extremely adept, and so I have high hopes that cvs2git is equally good.

    One thing to note: CVS is a pretty broken RCS. It's possible that it can have content that can't be reflected exactly in Git. In other words, there is some impedance mismatch there, but the tools try very hard to preserve as much as possible. Make sure to check your conversion and that you're happy with the results. You may need to fixup part of the Git history to get something more acceptable, but I doubt you'll need to.