我需要将客户从SVN迁移到Git,所以我想首先在公共SVN存储库上尝试svn2git。
我找到了几个公共repos,例如https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco和http://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
为什么会发生这种情况?是权限问题吗?
发布于 2017-09-01 20:08:41
好吧,到目前为止一切看起来都很好。如果失败,您应该指定失败的消息。
但除此之外,对于一次性迁移,git-svn (您使用的svn2git工具是基于git-svn的)是而不是用于存储库或部分存储库转换的正确工具。如果你想使用Git作为现有SVN服务器的前端,这是一个很棒的工具,但对于一次性转换,你不应该使用git-svn或基于它的工具,而应该使用更适合这种用例的svn2git。
有很多叫svn2git的工具,其中最好的可能是https://github.com/svn-all-fast-export/svn2git的KDE。我强烈推荐使用svn2git工具。它是我所知道的最好的,并且它非常灵活,你可以用它的规则文件做什么。基于git-svn的svn2git遭受了与pur git-svn相同的大部分缺点,只是解决了一些问题。
您将可以很容易地配置svn2git的规则文件,以从当前的SVN布局中生成您想要的结果,包括可能存在的任何复杂历史记录,并包括从一个SVN repo中生成多个Git repos,或者在一次运行中干净地将不同的SVN repos组合到一个Git repo中。
如果您不是100%了解存储库的历史,http://blog.hartwork.org/?p=763的svneverever是一个很好的工具,可以在将其迁移到Git时调查存储库的历史。
尽管git-svn更容易上手,但除了它的灵活性之外,还有一些使用KDE svn2git而不是git-svn的更好的原因:
Git
svn2git重建得更好更干净(如果使用了正确的代码),这对于更复杂的分支和合并历史尤其如此,比如
git-svn中标签是真实的标签,而不是分支。标签包含额外的空提交,这也使它们不是分支的一部分,所以正常的fetch不会获得它们,直到你给命令<代码>d30fetch>,因为默认情况下,只有指向获取的分支的标签才会被获取。如果您更改了
svn2git进行配置。使用git-svn,您将丢失历史记录svn2git您还可以轻松地将一个SVN存储库拆分为多个Git存储库
git-svn快数十亿倍
你看,有很多原因导致git-svn更差,而KDE svn2git更好。:-)
https://stackoverflow.com/questions/45999961
复制相似问题