如何将具有更改目录结构的svn存储库导入git?

时间:2010-09-24 15:46:34

标签: svn git git-svn

我有一个svn存储库,原始结构看起来像:

features/
   trunk/
   branch1/

然后随着时间的推移转移到标准的svn结构:

trunk/
branches/
tags/

有没有办法让svn2git或git svn使用它?或者,有没有办法以非破坏性的方式重写svn历史记录,以便repo从一开始就具有默认结构?

感觉我将不得不手动执行此操作(即识别目录更改结构的修订版本并编写将更改应用到具有特定结构的那些点的脚本,并重复直到我拥有整个历史记录git repo)。

这听起来并不是很有趣。帮助!

3 个答案:

答案 0 :(得分:2)

您可以尝试制作几个git-svn克隆,每个克隆一个特定结构的一个周期。然后将它们嫁接在一起。我在这里有一个相当简单的例子:

http://blog.tfnico.com/2010/10/gitsvn-6-grafting-together-svn-history.html

答案 1 :(得分:0)

您可能需要查看svn.borg.ch/svndumptool/以使存储库更好地进行布局。

答案 2 :(得分:0)

Use the following git-svn commands,

migrate one time (git to svn)

  • git svn clone (your-svn-repo-URL) --stdlayout
  • cd (your-project-folder)
  • git init
  • git remote add origin (your-git-repo-URL)
  • git add .
  • git commit

Migrate git to svn two-way sync

Using following commands to proceed with crontab,

  • git svn fetch
  • git svn rebase
  • git svn dcommit
相关问题