简体   繁体   English

将大型 SVN 存储库迁移到 Git 失败内存不足异常

[英]Migrating large SVN repo to Git failing Out of Memory Exception

I am trying to do a git svn clone of a very large SVN repo.我正在尝试对一个非常大的 SVN 存储库进行 git svn 克隆。 I have done earlier migrations using git svn clone with full branching, tags, and history maintained and all have gone well.我已经使用git svn clone完成了早期的迁移,并保留了完整的分支、标签和历史记录,一切进展顺利。 But this time the script after running for quite some time throws an error:但是这次运行一段时间后的脚本抛出错误:

libsvn: Out of memory - terminating application.18 [main] perl 13884 cygwin_exception::open_stackdumpfile: Dumping stack trace to perl.exe.stackdump

I researched everywhere but couldn't find anything related to this.我到处研究,但找不到与此相关的任何内容。 If somebody has encountered similar error I would appreciate any suggestions.如果有人遇到类似的错误,我将不胜感激任何建议。

git-svn is not the right tool for one-time conversions of repositories. git-svn不是一次性转换存储库的正确工具。 It is a great tool if you want to use Git as frontend for an existing SVN server, but for one-time conversions you should not use git-svn , but svn2git which is much more suited for this use-case and should not suffer from OOM error.如果你想使用 Git 作为现有 SVN 服务器的前端,这是一个很好的工具,但是对于一次性转换你应该使用git-svn ,但是svn2git更适合这个用例并且不应该受到影响OOM 错误。

There are pleny tools called svn2git , the probably best one is the KDE one from https://github.com/svn-all-fast-export/svn2git .有很多名为svn2git的工具,最好的可能是来自https://github.com/svn-all-fast-export/svn2git的 KDE 工具。 I strongly recommend using that svn2git tool.我强烈推荐使用那个svn2git工具。 It is the best I know available out there and it is very flexible in what you can do with its rules files.它是我所知道的最好的可用工具,而且您可以非常灵活地使用其规则文件进行操作。

If you are not 100% about the history of your repository, svneverever from http://blog.hartwork.org/?p=763 is a great tool to investigate the history of an SVN repository when migrating it to Git.如果您不是 100% 了解存储库的历史记录,来自http://blog.hartwork.org/?p=763svneverever是一个很好的工具,可以在将 SVN 存储库迁移到 Git 时调查它的历史记录。


Even though git-svn (or the wrong svn2git in your case) is easier to start with, here are some further reasons why using the KDE svn2git instead of git-svn is superior, besides its flexibility:尽管git-svn (或者在你的情况下是错误的svn2git )更容易开始,但除了它的灵活性之外,这里还有一些为什么使用 KDE svn2git而不是git-svn更优越的原因:

  • the history is rebuilt much better and cleaner by svn2git (if the correct one is used), this is especially the case for more complex histories with branches and merges and so on历史由svn2git重建得更好更干净(如果使用了正确的),对于具有分支和合并等的更复杂的历史尤其如此
  • the tags are real tags and not branches in Git标签是真正的标签,而不是 Git 中的分支
  • with git-svn the tags contain an extra empty commit which also makes them not part of the branches, so a normal fetch will not get them until you give --tags to the command as by default only tags pointing to fetched branches are fetched also.使用git-svn时,标签包含一个额外的空提交,这也使它们不属于分支,因此在您向命令提供--tags之前,正常的fetch不会获取它们,因为默认情况下,也只获取指向获取的分支的标签. With the proper svn2git tags are where they belong使用适当的 svn2git 标签是它们所属的位置
  • if you changed layout in SVN you can easily configure this with svn2git , with git-svn you will loose history eventually如果您更改了 SVN 中的布局,您可以使用svn2git轻松配置它,使用git-svn最终您将丢失历史记录
  • with svn2git you can also split one SVN repository into multiple Git repositories easily使用svn2git ,您还可以轻松地将一个 SVN 存储库拆分为多个 Git 存储库
  • or combine multiple SVN repositories in the same SVN root into one Git repository easily或将同一 SVN 根目录中的多个 SVN 存储库轻松合并到一个 Git 存储库中
  • the conversion is a gazillion times faster with the correct svn2git than with git-svn使用正确的svn2git的转换比使用git-svn快了无数倍

There are many reasons why git-svn is worse and the KDE svn2git is superior. git-svn更差而 KDE svn2git更优越的原因有很多。 :-) :-)

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

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