0

I want to migrate CVS repositories into Gitlab. I have multiple modules under a repository. I need to migrate as a single repository in Gitlab with all directories.

CVS Repository:

    Repository --->  module_1
                     module_2
                     module_3
                     module_4
                     module_5

I need to migrate the above modules into Repository.git as a single repository. How can I do this without losing the commit history of each branch and tags?

Note: I used cvs2git tool to migrate this, but it's missing few of commits from CVS.

I did the following steps to migrate as an individual module, it's getting migrated properly.

  1. yum install subversion
  2. svn --version
  3. svn co --username=guest --password="" http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
  4. cd cvs2svn-trunk
  5. mkdir cvs2git-tmp
  6. python cvs2git --blobfile=cvs2git-tmp/git-blob.dat --dumpfile=cvs2git-tmp/git-dump.dat --username=cvs2git /home/cvs/Repositories/module_1/ --fallback-encoding=UTF-8
  7. git init --bare /root/module_1-cvs2git.git
  8. cd /root/module_1-cvs2git.git/
  9. git fast-import --export-marks=../cvs2svn-trunk/cvs2git-tmp/git-marks.dat <../cvs2svn-trunk/cvs2git-tmp/git-blob.dat
  10. git fast-import --import-marks=../cvs2svn-trunk/cvs2git-tmp/git-marks.dat <../cvs2svn-trunk/cvs2git-tmp/git-dump.dat
  11. git gc --prune=now
  12. cd $HOME
  13. git clone /root/module_1-cvs2git.git
  14. cd module_1-cvs2git

I did the same steps and modified [6] step to migrate as single repo like the following and complete the migration which was missing few commits as well as added few more commits with the message "This commit was manufactured by cvs2svn to create branch".

Is this the way to migrate as a single repository? OR is there any other way or tool to migrate as a single repository?

[6]. python cvs2git --blobfile=cvs2git-tmp/git-blob.dat --dumpfile=cvs2git-tmp/git-dump.dat --username=cvs2git /home/cvs/Repositories/ --fallback-encoding=UTF-8

Any inputs here really appreciated.

SST
  • 2,054
  • 5
  • 35
  • 65
  • 1
    There's really no magic. You just do what you did to run `cvs2git` on each module except just point the `cvs2git` script at one directory higher. As long as the top directory has a CVSROOT subdirectory in it (contents don't matter) cvs2git will happily import it. – Mort Sep 29 '19 at 21:33
  • @Mort Thanks for your reply! I did the same way but the few commits were missing and few commits added. How to get rid of such cases? is there any option to avoid without missing history and adding extra commit while migration using CVS to GIT? – SST Sep 30 '19 at 06:09
  • I made some comments on your other StackOverflow questions about the missing and added commits. – Mort Sep 30 '19 at 14:34
  • (If you feel any of my answers were useful, please give them an "up arrow" and if they answered your question to your satisfaction, please accept them with a checkmark. Stack Overflow is gamified volunteering and I like to get my points. :-) – Mort Oct 04 '19 at 02:11

0 Answers0