Converting an SVN Repository to Git

I’ve come to prefer working with git to working with SVN, so I set about converting one of my small projects. GitHub says ‘We highly recommend using the svn2git tool to convert an SVN repo to a git repo. …For more detail on how to do the conversion using svn2git, check out the svn2git README.’ The README gives a number of simple-looking examples,so I got hold of svn2git and tried to run it. Luckily, I was using the -v option to get more informative logging messages…

Error message number 1:
Couldn't open a repository: Unable to open an ra_local session to URL: Unable to open repository 'file://C:/path/MyRepository': Can't open file '//C:/path/MyRepository/format': No such host or network path at /usr/lib/perl5/site_perl/Git/ line 310
The solution was to run svnserve and access the repository using the svn protocol. I followed the instructions here so I could access my repository as svn://localhost/MyRepository. I tried again and got…

Error message number 2:
Expected FS format between '1' and '3'; found format '4'
I eventually found an explanation of the message here: it indicates that the repository was created by a newer version of SVN than the one being used by the client trying to access it. TortoiseSVN, which the repository was created with, uses its own version of Subversion, but svn2git was using my older installed version. So I tracked down an installer for the version TortoiseSVN was using and set that up on my system.

I tried again and got…success! (But it did take a couple of hours to convert even my small repository.)


About Jennifer Phillips Campbell

Software Developer and Medieval Historian
This entry was posted in Version Control. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s