Springe zum Hauptinhalt Profilbild Hartmut Goebel

Hartmut Goebel

Diplom-Informatiker, CISSP, CSSLP, ISO 27001 Lead Implementer



Anfrage
Logo Goebel Consult

Convert SVN-Repo directly to git or hg (no dump-files needed)

Origo, where I'm hosting my open-source software up to now, is closing end of this month. So I need to move these projects somewhere else. I take the chance for migrating the subversion repositories to git. Here is how.

Origo, where I'm hosting my open-source software up to now, is closing end of this month. So I need to move these projects somewhere else. I take the chance for migrating the subversion repositories to git. Here is how.

If you are going to convert your repo to git or mercurial, you can use Eric S. Raymonds excellent `reposurgeon` tool. The current development version can read directly form subversion repositories. It's recommended to create a local mirror first. A tool called `svnpull` for pulling the SVN repo into a local mirror is provided.

Here is an example of a simple conversion of a simple repository:

PROJECT=ssl-audit
svnrepo=https://svn.origo.ethz.ch/$PROJECT
gitrepo=/tmp/$PROJECT-git

cd /tmp
repopuller $svnrepo

reposurgeon <<EOF
read /tmp/$PROJECT-mirror
prefer git
edit
references lift
rebuild $gitrepo
EOF