Springe zum Hauptinhalt

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

Ori­go, whe­re I'm hos­ting my open­-­sour­ce soft­ware up to now, is clo­sing end of this month. So I need to mo­ve the­se pro­jects so­me­whe­re el­se. I take the chan­ce for mi­gra­ting the sub­ver­si­on re­po­si­to­ries 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 ex­am­ple of a sim­ple con­ver­si­on of a sim­ple re­po­si­to­ry:

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
Portrait von Hartmut Goebel

Hartmut Goebel

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

Haben Sie noch Fragen?
Anruf oder Mail genügt:
  +49 871 6606-318
  +49 175 29 78 072
  h.goebel@goebel-consult.de