0

我需要将客户从 SVN 迁移到 Git,所以我想首先在公共 SVN 存储库上尝试 svn2git。

我找到了几个公共仓库,例如https://svn.alfresco.com/repos/alfresco-open-mirror/alfrescohttp://svn.apache.org/repos/asf/spamassassin。没有问题svn co,但是当我尝试 svn2git 时,我得到以下问题:

D:\Documents\work\svn2git\apache>svn2git http://svn.apache.org/repos/asf/spamassassin Initialized empty Git repository in D:/Documents/work/svn2git/apache/.git/ Using higher level of URL: http://svn.apache.org/repos/asf/spamassassin => http://svn.apache.org/repos/asf W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: REPORT request failed on '/repos/asf/!svn/bc/100': File not found: revision 100, path '/spamassassin' W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories Checked through r100 Checked through r200 Checked through r300

它运行了整个晚上,并以:

Checked through r22000 Checked through r22100 W: Ignoring error from SVN, path probably does not exist: (175002): RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org) W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories Checked through r477700 Path 'spamassassin' was probably deleted: RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org) Will attempt to follow revisions r477601 .. r477700 committed before the deletion r477601 .. r477679 OK Checked through r748600 Path 'spamassassin' was probably deleted: RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org) Will attempt to follow revisions r748501 .. r748600 committed before the deletion Checked through r748700 Checked through r748800 Checked through r748900 Checked through r749000 Checked through r749100 Checked through r749200 Checked through r749300 Checked through r749400 W: Ignoring error from SVN, path probably does not exist: (175002): RA layer request failed: PROPFIND request failed on '/repos/asf/!svn/vcc/default': PROPFIND of '/repos/asf/!svn/vcc/default': could not connect to server (http://svn.apache.org) W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories Checked through r805700 Path 'spamassassin' was probably deleted: RA layer request failed: PROPFIND request failed on '/repos/asf/!svn/vcc/default': PROPFIND of '/repos/asf/!svn/vcc/default': could not connect to server (http://svn.apache.org) Will attempt to follow revisions r805601 .. r805700 committed before the deletion Checked through r805800 Checked through r805900 Checked through r806000 Checked through r806100 Checked through r806200 Checked through r806300 Checked through r806400 Checked through r806500 Checked through r806600 Checked through r806700 command failed: git checkout -f master

为什么会发生?是权限问题吗?

4

1 回答 1

0

好吧,到目前为止一切看起来都很好。如果失败,您应该指定失败的消息。

但除此之外,对于一次性迁移git-svnsvn2git您使用的工具基于git-svn不是转换存储库或存储库部分的正确工具。如果您想使用 Git 作为现有 SVN 服务器的前端,它是一个很好的工具,但对于一次性转换,您不应该使用git-svn基于它的工具,但svn2git它更适合这个用例。

有很多称为svn2git的工具,可能最好的是来自https://github.com/svn-all-fast-export/svn2git的 KDE 工具。我强烈建议使用该svn2git工具。这是我所知道的最好的,并且在你可以用它的规则文件做什么方面非常灵活。基于svn2gitgit-svnpur 具有与 pur 相同的大多数缺点git-svn,只是解决了一些问题。

您将能够轻松配置svn2gits 规则文件以从当前 SVN 布局中生成所需的结果,包括可能存在的任何复杂历史记录,包括从一个 SVN 存储库生成多个 Git 存储库或将不同的 SVN 存储库干净地组合到一个 Git 存储库中如果您愿意,可以一口气运行。

如果您不是 100% 了解存储库的历史,那么在将 SVN 存储库迁移到 Git 时,svnevereverhttp ://blog.hartwork.org/ ?p=763是一个调查 SVN 存储库历史的好工具。


尽管git-svn更容易开始,但除了灵活性之外,还有一些使用 KDEsvn2git而不是更优越的原因:git-svn

  • 通过(如果使用正确的),历史被重建得更好,更清晰,svn2git对于具有分支和合并等的更复杂的历史尤其如此
  • 标签是真正的标签,而不是 Git 中的分支
  • 标签包含git-svn一个额外的空提交,这也使它们不是分支的一部分,因此在fetch您提供命令之前,正常情况下不会获取它们,--tags因为默认情况下也只会获取指向已获取分支的标签。使用正确的 svn2git 标签是它们所属的地方
  • 如果您更改了 SVN 中的布局,您可以轻松地配置它svn2gitgit-svn最终您将失去历史
  • 您还可以轻松地svn2git将一个 SVN 存储库拆分为多个 Git 存储库
  • 或轻松将同一个 SVN 根目录中的多个 SVN 存储库合并到一个 Git 存储库中
  • svn2git正确的转换比使用正确的要快无数倍git-svn

你看,有很多原因导致git-svnKDE 更差而 KDEsvn2git更胜一筹。:-)

于 2017-09-01T12:08:41.343 回答