Migrate from CVS to Git without losing history

后端 未结 8 1627
旧时难觅i
旧时难觅i 2020-12-07 16:41

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?

8条回答
  •  暖寄归人
    2020-12-07 17:13

    Migration from CVS to Git using cvs2svn

    Sharing all step for migration CVS to git

    1. create directory a cvsProject in anyDir

    Rsync: your cvs repo:  
     1. $rsync -av  CVSUserName@CVSipAdrress:/CVS_Path/ProjectName/*  ~/anyDir/ProjectName
    
    2. cd $../cvs2svn-x.x.0 && ./cvs2git --options=cvs2git-example.options
    3. $./cvs2git --blobfile=cvs2git-tmp/git-blob.dat \ --dumpfile=cvs2git-tmp/git-dump.dat \ --username=CVS_YOUR_USER_NAME \ /path_of_step(1)/cvsProject
    Note: if get any encoding error then add this into above command:"--encoding=ascii --encoding=utf8 --encoding=utf16 --encoding=latin"
    4. mkdir newGitRepo && cd newGitRepo 5. git init --bare 6. git fast-import --export-marks=/x.x.x/cvs2svn-2.5.0/cvs2git-tmp/git-marks.dat \

    wow now you are done, now you can push your repo to git..

    Referenece : [link1][2] ,[link2][2]

提交回复
热议问题