Migrate from CVS to Git without losing history

后端 未结 8 1616
旧时难觅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:15

    In order to clone a project from sourceforge to github I performed the following steps.

    PROJECT=some_sourceforge_project_name
    GITUSER=rubo77
    rsync -av rsync://a.cvs.sourceforge.net/cvsroot/$PROJECT/\* cvs
    svn export --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
    cp ./cvs2svn-trunk/cvs2git-example.options ./cvs2git.options
    vim cvs2git.options # edit run_options.set_project
    cvs2svn-trunk/cvs2git --options=cvs2git.options --fallback-encoding utf-8
    

    create an empty git at https://github.com/$GITUSER/$PROJECT.git

    git clone git@github.com:$GITUSER/$PROJECT.git $PROJECT-github
    cd $PROJECT-github
    cat ../cvs2git-tmp/git-{blob,dump}.dat | git fast-import
    git log
    git reset --hard
    git push
    

提交回复
热议问题