简体   繁体   English

使用通用中继将庞大的SVN存储库迁移到Git

[英]Migrate huge SVN repo with common trunk to Git

I need to migrate a really huge SVN trunk with commit history to Git . 我需要将具有提交历史记录的超大型SVN中继迁移到Git。 The SVN repository has the following structure: SVN存储库具有以下结构:

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. 我只对将主干中的每个项目移动到相应的Git存储库非常感兴趣-并不真正在乎标签和分支。 Correct me if I'm wrong, but I believe Git doesn't work well with extremely large repositories. 如果我错了,请纠正我,但是我相信Git在非常大的存储库中不能很好地工作。

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,但他们假设每个项目都在其自己的文件夹中,并且具有主干,分支和标签层次结构。 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. 当我尝试明确指定中继文件夹并将标签和分支指向一个空文件夹时,SubGit只是在一段时间后停止响应。

Since version 3.0 SubGit can work with single directories (in earlier versions it required trunk, branches, and tags as you wrote). 由于版本3.0的 SubGit可以使用单个目录(在早期版本中,它需要您编写的主干,分支和标签)。 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 如果您的存储库没有遵循最佳实践,并且有很多文件没有设置svn:eol-style ,则最好添加

[translate]
  eols=false

option to the end of repo1.git/subgit/config file at "adjust" step above. 选项位于repo1.git / subgit / config文件末尾的“调整”步骤。 This will turn EOLs translation off. 这将关闭EOLs翻译。

When it seems that SubGit has no progress it may checkout your trunk which as you told is huge. 当SubGit似乎没有进度时,它可能会检查您的中继,正如您所说的,中继非常大。 It writes to a some of ~/.subgit/logs/ files, so you can track progress by looking there. 它会写一些〜/ .subgit / logs /文件,因此您可以通过查看那里来跟踪进度。 After fetching the first revision, it displays progress explicitly. 在获取第一个修订版之后,它将明确显示进度。

Disclaimer: I'm one of SubGit developers. 免责声明:我是SubGit开发人员之一。

For such easy task you can 对于这样简单的任务,您可以

  1. Read Git-svn doc 阅读Git-svn文档
  2. See your case (track single URL) in Basic Examples section 在“基本示例”部分中查看您的案例(跟踪单个URL)
  3. Try to use git svn clone URL/trunk/project* for every project in trunk 尝试对git svn clone URL/trunk/project*中的每个项目使用git svn clone URL/trunk/project*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM