Beto
Beto

Reputation: 579

How to migrate svn repository to git with 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?

Upvotes: 4

Views: 1295

Answers (1)

jira
jira

Reputation: 3944

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.

Upvotes: 3

Related Questions