简体   繁体   English

合并存储库时从svn转换为git的最佳方法?

[英]Best way to convert from svn to git while merging repositories?

svn-all-fast-export looks to be a great way to move from svn to git and it supports splitting one svn repository into multiple git repositories. svn-all-fast-export似乎是从svn迁移到git的一种好方法,它支持将一个svn存储库拆分为多个git存储库。

I want to do the opposite. 我想相反。 I have a set of closely-related svn repositories. 我有一组密切相关的svn存储库。 They all branch at the same time with the same branch names. 它们都以相同的分支名称同时分支。 Tagging is the same across all repositories. 所有存储库中的标记均相同。 I want to combine them into one git repository, with the files from each svn repository in its own subdirectory. 我想将它们合并到一个git存储库中,每个svn存储库中的文件都放在其自己的子目录中。 I want the histories interleaved so that, for example, commits to trunk in each repository appear on master in git in date order. 我希望历史记录相互交织,例如,提交到每个存储库中的主干的日期按日期顺序在git中显示在master上。

More concretely, I have svn repositories with trunk commits shown numbered in time order (commits on each branch look similar): 更具体地说,我有svn存储库,其中显示了以时间顺序编号的主干提交(每个分支上的提交看起来都相似):

A
  commit 1
  commit 4
B
  commit 2
  commit 3
  commit 8
C
  commit 5
  commit 6
  commit 7

I'd like to convert to the following in git: 我想在git中转换为以下内容:

bigproject/
  A/
  B/
  C/

With a history on master that looks like: 关于母版的历史记录如下:

commit 1
commit 2
commit 3
commit 4
commit 5
commit 6
commit 7
commit 8

Can svn-all-fast-export do this? svn-all-fast-export可以这样做吗? I haven't found any examples of it. 我还没有找到任何例子。 Is there another existing tool to do it? 是否有其他现有工具可以执行此操作?

I have used SubGit on a previous project for performing a Subversion to Git migration that was slightly simpler than what you are trying to accomplish. 我在先前的项目中使用SubGit来执行从Subversion到Git的迁移,这比您要完成的工作稍微简单一些。 Personally, I tried using several migration tools before SubGit, and was pleasantly surprised with the overall usability and common sense configuration options. 就个人而言,我在SubGit之前尝试使用了几种迁移工具,并对整体可用性和常识性配置选项感到惊喜。

The following post also has some ideas how you can leverage a tool like SubGit to accomplish your task: https://serverfault.com/questions/420828/migrate-multiple-svn-repositories-into-single-git-repository . 以下帖子还对如何利用SubGit之类的工具完成任务提供了一些建议: https ://serverfault.com/questions/420828/migrate-multiple-svn-repositories-into-single-git-repository。 But once again, I would definitely suggest SubGit over something like the git-svn bridge that comes built into git (which seems to be extremely fragile at times) for the basic migration tasks. 但是再一次,我肯定会建议SubGit使用诸如git内置的git-svn桥之类的东西(有时似乎非常脆弱)来进行基本的迁移任务。

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

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