Chris Nelson
Chris Nelson

Reputation: 3707

How can I convert a large SVN repo to Git?

I'm trying to convert several SVN repositories to Git. Two have gone smoothly. When I try to convert the next, large-ish one, I get errors from git svn clone. First a bunch of:

W: Refspec glob conflict (ref: refs/remotes/origin/tags/Something-Perl):
expected path: something/trunk/tags/Something-Perl
    real path: something/tags/Something-Perl

for various "something." Then one:

Initializing parent: refs/remotes/origin/TheName@27584
Use of uninitialized value $args[1] in join or string at /usr/share/perl5/vendor_perl/Git.pm line 1635.
Use of uninitialized value $_[2] in exec at /usr/share/perl5/vendor_perl/Git.pm line 1661.
fatal: Not a valid object name
ls-tree -z  ./: command returned error: 128

Digging, I find line 1635 is

return wantarray ? ($fh, join(' ', $cmd, @args)) : $fh;

Google found a few instances of errors in Git.pm or SVN.pm but not this one. (For reference, I'm using git version 2.19.1 on Linux.)

I really only want two of the directories in that repo so I tried to follow Migrating a large SVN repo to git but I end up with an empty Git repo:

[MyNewRepo]$ git status
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)

Any thoughts?

Upvotes: 1

Views: 706

Answers (1)

EncryptedWatermelon
EncryptedWatermelon

Reputation: 5598

If you are only exporting to git you are better of using the KDE svn2git. It's much faster and allows you to create annotated tags. https://github.com/svn-all-fast-export/svn2git

Upvotes: 1

Related Questions