[英]Error while using svn2git for SVN to GIT migration
I am getting below error when I tried to use svn2git command to import svn files 尝试使用svn2git命令导入svn文件时出现以下错误
Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk --tags=tags --branches=branches https://svnserver.com/abc/svn/projectname Running command: git svn fetch Invalid filesystem revision number: svn: E160006: Invalid revision number '-1' at /mingw64/share/perl5/site_perl/Git/SVN.pm line 150. command failed: git svn fetch 运行命令:git svn init --prefix = svn / --no-metadata --trunk = trunk --tags = tags --branches = branches https://svnserver.com/abc/svn/projectname运行命令:git svn提取无效的文件系统修订号:svn:E160006:无效的修订号'-1'在/mingw64/share/perl5/site_perl/Git/SVN.pm第150行。命令失败:git svn提取
I got the same error when I tried to check out using tortoise SVN client. 当我尝试使用Tortoise SVN客户端签出时出现了相同的错误。 Then I installed the client same as the SVN server version and the issue got resolved. 然后,我安装了与SVN服务器版本相同的客户端,问题得到解决。
But when using svn2git , same error occurs? 但是,当使用svn2git时 ,会发生同样的错误吗? Is there any version compatibility issue? 是否存在任何版本兼容性问题? I am using SVN 1.7.9 and svn2git 2.3.2. 我正在使用SVN 1.7.9和svn2git 2.3.2。
You are using an svn2git
tool that uses git-svn
under the hood. 您正在使用一个在svn2git
使用git-svn
的svn2git
工具。
For a one-time migration git-svn
is not the right tool for conversions of repositories or parts 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. 这是一个伟大的工具,如果你想使用Git的作为前端为现有的SVN服务器,但对于一次性转换,你不应该使用git-svn
,但svn2git
这是该用例更加适合。
There are plenty 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. 这是我所知道的最好的,它可以很灵活地处理其规则文件。
You will be easily able to configure svn2git
s rule file to produce the result you want from your current SVN layout, including any complex histories that might exist and including producing several Git repos out of one SVN repo or combining different SVN repos into one Git repo cleanly. 您将能够轻松配置svn2git
的规则文件,以从当前SVN布局中生成所需的结果,包括可能存在的任何复杂历史记录,以及从一个SVN存储库中生成多个Git存储库,或将不同的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. 如果您不是100%知道存储库的历史记录,请从http://blog.hartwork.org/?p=763中 svneverever
,这是在将SVN存储库迁移到Git时调查其历史记录的绝佳工具。
Even though git-svn
(or the svn2git you used) 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
更为优越:
svn2git
(if the correct one is used), this is especially the case for more complex histories with branches and merges and so on svn2git
(如果使用了正确的历史记录)可以更好,更干净地重建历史记录,对于具有分支和合并等更复杂历史记录的情况尤其如此 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
交给命令, --tags
正常的fetch
将不会获取它们,因为默认情况下,还会仅获取指向获取的分支的标签。 With the proper svn2git tags are where they belong 带有正确的svn2git标签是它们所属的位置 svn2git
, with git-svn
you will loose history eventually 如果您在SVN中更改了布局,则可以轻松地使用svn2git
配置,而使用git-svn
最终会丢失历史记录 svn2git
you can also split one SVN repository into multiple Git repositories easily 使用svn2git
您还可以轻松地将一个SVN存储库拆分为多个Git存储库 svn2git
than with git-svn
正确的svn2git
比git-svn
快svn2git
倍 You see, 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.