git svn clone正在跳过修订 [英] git svn clone is skipping revisions

查看:104
本文介绍了git svn clone正在跳过修订的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将svn存储库转换为git.但是,当我在当前的svn存储库上运行"git svn clone"时,许多修订都被跳过了.

I am converting our svn repository to git. However, when I run "git svn clone" on our current svn repo, many revisions are getting skipped.

例如,跳过了svn修订版2,但是当我在svn仓库中运行"svn log -r 2"时,会有一个条目.

For example, svn revision 2 is skipped, but when I run "svn log -r 2" in our svn repo, there is an entry for it.

值得注意的是,当我仅在svn存储库中运行"svn log"时,未列出修订版2.仅当直接引用时才会显示.

It's worth noting that when I just run "svn log" in our svn repo, revision 2 is not listed. It's only shown when referenced directly.

我假设svn历史记录在过去的某个时候被删除了,但实际上并没有删除.

I'm assuming svn history was sort of deleted, but not really, at one point in the past.

假设是问题所在,即使从svn中删除,我该如何进行git svn克隆并获得所有修订?

How can I do the git svn clone and get all revisions even when deleted from svn, assuming that's the issue?

推荐答案

SVN通常不会删除历史记录.我不确定这是否可行.您应该查看在该修订版中更改的内容.我的猜测是,仅更改的路径不属于要转换的历史记录的一部分.但是要肯定地说,我需要查看修订版本和您的git-svn命令.

SVN will not have history deleted usually. I'm not sure if this is possible anyway. You should look at what was changed in that revision. My guess is that only paths were changed that are not part of the history you are converting. But to say this for sure I would need to see the revision changes and your git-svn command.

但是无论如何,对于一次性迁移而言,git-svn不是不是用于转换存储库或部分存储库的正确工具.如果要将Git用作现有SVN服务器的前端,这是一个很好的工具,但是对于一次性转换,您应该使用git-svn,但是svn2git更适合这个用例.

But anyway, for a one-time migration git-svn is not the right tool for conversions of repositories or parts of repositories. 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.

有很多称为svn2git的工具,可能最好的工具是来自 https://github.com/svn-all-fast-export/svn2git .我强烈建议使用该svn2git工具.这是我所知道的最好的,它在处理规则文件方面非常灵活.

There are plenty tools called svn2git, the probably best one is the KDE one from https://github.com/svn-all-fast-export/svn2git. I strongly recommend using that svn2git tool. It is the best I know available out there and it is very flexible in what you can do with its rules files.

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

You will be easily able to configure svn2gits rule file to produce the result you want from your current SVN layout, including any complex histories like yours that might exist and including producing several Git repos out of one SVN repo or combining different SVN repos into one Git repo cleanly in one run if you like.

如果您不是100%了解存储库的历史记录,请从 http://blog.hartwork.org/?p=763 是将SVN储存库迁移到Git时研究其历史的绝佳工具.

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.

尽管git-svn或神经鼓svn2git较容易入门,但还有一些其他原因为什么除了灵活性之外,使用KDE svn2git代替git-svn更为优越:

Even though git-svn or the nirvdrum svn2git is easier to start with, here are some further reasons why using the KDE svn2git instead of git-svn is superior, besides its flexibility:

  • 使用svn2git可以更好地重建历史记录(如果使用了正确的历史记录),对于具有分支和合并等更复杂历史记录的情况尤其如此.
  • 标签是真实标签,不是Git中的分支
  • 带有git-svn的标记包含一个额外的空提交,这也使它们不属于分支,因此普通的fetch不会得到它们,直到您将--tags赋予命令为止,因为默认情况下仅指向提取的分支也将被提取.带有正确的svn2git标签是它们所属的地方
  • 如果您在SVN中更改了布局,则可以轻松地使用svn2git进行配置,而使用git-svn最终会丢失历史记录
  • 使用svn2git,您还可以轻松地将一个SVN存储库拆分为多个Git存储库
  • 或将同一SVN根目录中的多个SVN存储库轻松组合到一个Git存储库中
  • 使用正确的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
  • the tags are real tags and not branches in 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. With the proper svn2git tags are where they belong
  • if you changed layout in SVN you can easily configure this with svn2git, with git-svn you will loose history eventually
  • with svn2git you can also split one SVN repository into multiple Git repositories easily
  • or combine multiple SVN repositories in the same SVN root into one Git repository easily
  • the conversion is a gazillion times faster with the correct svn2git than with git-svn

您看到,git-svn较差而KDE svn2git较优的原因很多. :-)

You see, there are many reasons why git-svn is worse and the KDE svn2git is superior. :-)

这篇关于git svn clone正在跳过修订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆