2

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.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
madridista
  • 79
  • 12

2 Answers2

2

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.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38
  • I just want to perform a one-time migration (without synchronization). The documentation reads "Run SubGit configure command to make SubGit create empty bare Git repository and link it with a project in Subversion." – madridista Aug 10 '15 at 16:22
  • "subgit configure" prepares default configuration files, "subgit install" links and synchronizes the repositories. When "subgit install" finishes, just run "subgit uninstall --purge repo1.git". It will disable synchronization and remove SubGit-related files. This is one-time migration with SubGit (which is of course free). By the way, you can then run "git update-ref refs/notes/commits refs/svn/map" to make "git log" display revision numbers. – Dmitry Pavlenko Aug 10 '15 at 16:30
  • @DmitryPavlenko, "When it seems that SubGit has no progress", logs in some case keeps unchanged for a long time. I use: `sudo tcpdump -i wlan0 host svn.host.com and port 433` and `watch -n 5 du -s .` at the repo directory for monitoring ;-) Currently I just tries SubGit. – Monah Tuk Apr 18 '18 at 00:47
1

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
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110