Is there a migration tool from CVS to Git?

前端 未结 12 1822
栀梦
栀梦 2020-11-27 13:34

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?

相关标签:
12条回答
  • 2020-11-27 13:39

    cvs2git

    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

    1. checkout modulename

      cvs -d URL co -P modulename
      
    2. create an empty CVSROOT needed by cvs2git

      mkdir modulename/CVSROOT
      
    3. download an example of cvs2git.options at http://cvs2svn.tigris.org/svn/cvs2svn/trunk/cvs2git-example.options (user "guest" with no password)

    4. 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>',
      
    5. run cvs2git to create git temp files

      cvs2git  --options=cvs2git.options --fallback-encoding utf-8
      
    6. create git repository

      mkdir gitrepo && cd gitrepo && git init .
      
    7. import from git temp files created by cvs2git

      cat ../cvs2git-tmp/git-{blob,dump}.dat | git fast-import
      
    8. checkout working copy

      git reset --hard
      
    0 讨论(0)
  • 2020-11-27 13:39

    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.

    0 讨论(0)
  • 2020-11-27 13:40

    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.

    0 讨论(0)
  • 2020-11-27 13:41

    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.

    0 讨论(0)
  • 2020-11-27 13:41

    An alternative might be to use git cvsimport *

    0 讨论(0)
  • 2020-11-27 13:53

    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.

    0 讨论(0)
提交回复
热议问题