Search code examples
gitsvngit-svnsvn2git

Svn2git Migration: Repository/Project Complication


I have 3 svn repositories, each having 30~ projects in them. I want to convert these 3 svn repositories into Git repositories, with their respective projects kept inside. To give a clear idea, where is the representation of the structure I have:

-Repository1
  -- project1
  -- project2
  -- project3
  -- project4
  -- project5
-Repository2
  -- project1
  -- project2
  -- project3
  -- project4
  -- project5
-Repository3
  -- project1
  -- project2
  -- project3
  -- project4
  -- project5

I tried a lot of tutorials so far, none worked for my purpose. Most of the tutorials suggest that I create a repository per project, which I find not-okay, as this is not the pattern I have with my svn.

When I execute a command like this:

svn2git http://address/address/Repository1/project1 --authors ../authormap.txt --metadata

it creates a folder of the project as a git repository, which I don't want; because this is not the case with my svn structure.

So I need a command which converts my entire repository (along with the 30 projects in it) into a Git repository. I was told to remove the projectName at the end of the address, like this:

svn2git http://address/address/Repository1 --authors ../authormap.txt --metadata

however it did not work, I got:

command failed:
git checkout -f master

I have been trying methods for almost a day, no luck so far. It should not be this frustrating and complicated to convert a repository. Anyone has a solid idea on the matter?


Solution

  • There are pleny tools called svn2git, but from your question I'd guess you are not using the KDE one from https://github.com/svn-all-fast-export/svn2git. I strongly recommend using that svn2git tool. It is the best I know available out there and it is very flexible in what you can do with its rules files.

    You will easily be able to configure it for your layout to get the result you want and expect.

    If you are not 100% about the history of your repository, svneverever from http://blog.hartwork.org/?p=763 is a great tool to investigate the history of a SVN repository when migrating it to Git.