Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git svn migration failing with svn 1.8

I'm following the steps in: http://git-scm.com/book/en/v2/Git-and-Other-Systems-Git-as-a-Client

to move an svn repository to git. My local svn version is:

$ svn --version svn, version 1.8.10 (r1615264) compiled Aug 25 2014, 10:52:18 on x86_64-apple-darwin12.5.0

git version:

$ git --version git version 2.1.0

When I clone the repository I get an error reading the local file system format:

$ git svn clone file:///tmp/test-svn -s
Initialized empty Git repository in /private/tmp/test-svn/.git/
Couldn't open a repository: Unable to connect to a repository at URL 'file:///tmp/test-svn': Unable to open an ra_local session to URL: Unable to open repository 'file:///tmp/test-svn': Expected FS format between '1' and '4'; found format '6' at /usr/local/Cellar/git/2.1.0/lib/perl5/site_perl/Git/SVN.pm line 310

According to this svn release note FS format 6 was introduced in svn 1.8: http://subversion.apache.org/docs/release-notes/1.8.html#revprop-packing

Could it be the git 2.1 Perl script isn't yet compatible with this svn release? More importantly how can I get this svn repository converted to git?

like image 481
saschwarz Avatar asked Dec 02 '14 01:12

saschwarz


People also ask

Which migration is actually recommended for migration from SVN to Git?

When moving to Git from another version control system like Subversion (SVN), we generally recommend that you perform a "tip migration", which migrates just the latest version of the repository contents, without including history.

Can you use Git and SVN together?

git-svn is a specialized tool for Git users to interact with Git repositories. It works by providing a Git frontend to an SVN backend. With git-svn, you use Git commands on the local repository, so it's just like using normal Git. However, behind the scenes, the relevant SVN commands are sent to the server.

Which is Better Git or SVN?

SVN is better than Git for architecture performance, binary files, and usability. And it may be better for access control and auditability, based on your needs.


1 Answers

I got an answer on the git-users email list.

The solution is to run a local svnserver and use the svn protocol when running git svn clone instead of the file protocol. That avoids git-svn needing to parse the svn 1.8 file format.

Suppose your repository is in a directory /path/to/repository/test-svn. Change into the /tmp directory and run

svnserve -d -r /path/to/repository

Then you can run

git svn clone svn://127.0.0.1/test-svn -s

Afterwards, stop the svnserver and delete the temporary svn repository.

like image 71
saschwarz Avatar answered Oct 28 '22 10:10

saschwarz