Migrate huge SVN repo with common trunk to Git

1.2k Views Asked by At

I need to migrate a really huge SVN trunk with commit history to Git . The SVN repository has the following structure:

branches/
    project1-branch1
    project1-branch2
    project2-branch1
    project2-branch2
tags/
    project1-1.0
    project1-1.1
trunk/
    project1/
    project2/
    project3/
    project4/

I am only really interested in moving each project in the trunk to a corresponding Git repository--don't really care about the tags and branches. Correct me if I'm wrong, but I believe Git doesn't work well with extremely large repositories.

There have been similar questions asked in the past but they're pretty old and just want to know if anyone has a fresh perspective on approaching this problem. I tried a couple of tools such as SubGit but they assume that every project is in it's own folder and has a trunk, branches, and tags hierarchy. SubGit just stops responding after a while when I try to explicitly specify the trunk folder and point the tags and branches to an empty folder.

2

There are 2 best solutions below

0
On BEST ANSWER

For such easy task you can

  1. Read Git-svn doc
  2. See your case (track single URL) in Basic Examples section
  3. Try to use git svn clone URL/trunk/project* for every project in trunk
3
On

Since version 3.0 SubGit can work with single directories (in earlier versions it required trunk, branches, and tags as you wrote). To do that you can run

$ subgit configure --svn-url <URL>/trunk/project1 --layout directory repo1.git
# adjust repo1.git/subgit/config configuration
$ subgit install repo1.git

If your repository doesn't follow best practices and has a lot of files with no svn:eol-style set, probably you would better add

[translate]
  eols=false

option to the end of repo1.git/subgit/config file at "adjust" step above. This will turn EOLs translation off.

When it seems that SubGit has no progress it may checkout your trunk which as you told is huge. It writes to a some of ~/.subgit/logs/ files, so you can track progress by looking there. After fetching the first revision, it displays progress explicitly.

Disclaimer: I'm one of SubGit developers.