Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate svn repository to git with svn2git?

Tags:

git

svn

svn2git

I want to migrate a repository from svn to git. I'm using svn2git from this repository: https://github.com/svn-all-fast-export/svn2git

When I do : svn2git/svn-all-fast-export --rules ruleset/module svn/module

I get this error:

svn: E000002: : Can't open file 'svn/module/format': No such file or directory

This Format file does not exist.

Where the svn/module folder is my repository that contains a trunk folder and tags folder, both with files inside.

The ruleset/module file has:

create repository module
end repository


match /trunk/module/
  repository module/
  branch master
end match

match /tags/module_(\d+)
  repository module
  branch master
end match

Does anyone know how to solve this problem?

like image 354
Beto Avatar asked Sep 14 '25 05:09

Beto


1 Answers

You are probably trying to convert svn working copy not a repository. If your repository is hosted at remote location then first create a dump using svnadmin.

svnadmin dump

Then create a local repo:

svnadmin create /path/to/repo

Check svnadmin help create for compatibility options. You might need to use

--pre-1.6-compatible

Then load the dump svnadmin load /path/to/repo < dump

Then you can migrate the newly created local repo.

like image 152
jira Avatar answered Sep 15 '25 21:09

jira