SourceForge.net: Migrating from CVS to GIT...

As I have been planning for a long time to do this move, I will post here my experiences with one of my projects at sourceforge.net to migrate it from CVS to GIT... Here are the steps, and believe me, those seem to be the safe one (the logical ones didn't work as well as those):
  1. Backup your project:
  2. rsync -av rsync://jlibdc1394.cvs.sourceforge.net/cvsroot/jlibdc1394/* .
  3. Transfer one module to a svn repo:
  4. Install the svn2git:
    git clone git://github.com/jcoglan/svn2git.git
    rake gem
    sudo gem install pkg/svn2git-1.0.0.gem
    # On ubuntu you run it with /var/lib/gems/1.8/bin/svn2git file:///...
  5. For each module, you will create an empty directory and inside that directory run:
     /var/lib/gems/1.8/bin/svn2git file:///PATH_TO_MODULE
  6. Well, this gives you a bunch of modules, with their branches, if you had them. So, from here, your hell begins... Myself, I had 3 modules, that I checkout in branches. I did it in empty branches for each module:
    git symbolic-ref HEAD refs/heads/MODULE_NAME
    #removed everything from the old branch switch...
    rm .git/index
    git clean -fdx
    git push --all
  7. You can also move some remote branches, or move:
    git push origin origin/OLD:refs/heads/NEW
    # delete the old branch
    git push origin :OLD
  8. This should give you enough flexibility and people can still use those branches. Idealy, you should have super-project and sub-projects. But git is not that great on that yet... and the tools are also failing on this topic.
  9. You can see the results from here: http://jlibdc1394.git.sourceforge.net/git/gitweb.cgi?p=jlibdc1394

No comments: