Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating a multi-project Subversion repository to Git with reposurgeon

I'm trying to convert a Subversion repository to Git using reposurgeon, the repository holds several projects with the following layout:

<groupname>/<projectname>/{trunk,tags,branches}

I tried this reposurgeon script:

read <svnrepository.dump
sourcetype svn
prefer git
rebuild myrepository

But the result was a Git repository with a branch per group.

Is there a way to restrict the conversion to a single project?

like image 236
Emmanuel Bourg Avatar asked Jan 16 '20 01:01

Emmanuel Bourg


1 Answers

Use the --include option of svnadmin dump to restrict the dump to one project, then repocutter to strip away the path prefix.

svnadmin dump . --include '/<groupname>/<projectname>' | 
    repocutter pathrename '^<groupname>/<projectname>/' '' > svnrepository.dump

Then use reposurgeon as before.

like image 96
user3840170 Avatar answered Oct 25 '22 10:10

user3840170