git svn迁移失败与svn 1.8 [英] git svn migration failing with svn 1.8
问题描述
我遵循以下步骤:
http://git-scm.com/book/en/v2/Git-and-Other-Systems-Git-as-a-Client
移动一个svn仓库到git。我的本地svn版本是:
$ svn --version
svn,版本1.8.10(r1615264)
编译2014年8月25日,10:52:18在x86_64-apple-darwin12.5.0
git版本:
$ git --version
git version 2.1.0
我克隆存储库我得到一个读取本地文件系统格式的错误:
$ git svn克隆文件:/// tmp / test-svn -s
在/private/tmp/test-svn/.git/
中初始化了空的Git存储库无法打开存储库:无法连接到存储库的URL'file:// / tmp / test-svn':无法打开ra_local会话到URL:无法打开存储库文件:/// tmp / test-svn':'1'和'4'之间的期望FS格式;在/usr/local/Cellar/git/2.1.0/lib/perl5/site_perl/Git/SVN.pm中找到格式'6'第310行
根据svn发布的说明,FS格式6在svn 1.8中引入:
http://subversion.apache.org/docs/release-notes/1.8.html#revprop-packing
它可能是git 2.1 Perl脚本还不兼容这个svn版本吗?更重要的是,我怎样才能将这个svn库转换为git?
我在git-users电子邮件列表上找到了答案。
解决方案是在运行'git svn clone'而不是'file'协议时运行本地svnserver并使用'svn'协议。这避免了git-svn需要解析svn 1.8文件格式。
所以我改成了 / tmp
目录并运行 svnserve -d
。
然后我能够 git svn clone svn://127.0.0.1/test-svn -s
并且它完美无缺。然后我停止了svnserver并删除了临时svn仓库。
I'm following the steps in: http://git-scm.com/book/en/v2/Git-and-Other-Systems-Git-as-a-Client
to move an svn repository to git. My local svn version is:
$ svn --version
svn, version 1.8.10 (r1615264)
compiled Aug 25 2014, 10:52:18 on x86_64-apple-darwin12.5.0
git version:
$ git --version
git version 2.1.0
When I clone the repository I get an error reading the local file system format:
$ git svn clone file:///tmp/test-svn -s
Initialized empty Git repository in /private/tmp/test-svn/.git/
Couldn't open a repository: Unable to connect to a repository at URL 'file:///tmp/test-svn': Unable to open an ra_local session to URL: Unable to open repository 'file:///tmp/test-svn': Expected FS format between '1' and '4'; found format '6' at /usr/local/Cellar/git/2.1.0/lib/perl5/site_perl/Git/SVN.pm line 310
According to this svn release note FS format 6 was introduced in svn 1.8: http://subversion.apache.org/docs/release-notes/1.8.html#revprop-packing
Could it be the git 2.1 Perl script isn't yet compatible with this svn release? More importantly how can I get this svn repository converted to git?
I got an answer on the git-users email list.
The solution is to run a local svnserver and use the 'svn' protocol when running 'git svn clone' instead of the 'file' protocol. That avoids git-svn needing to parse the svn 1.8 file format.
So I changed into the /tmp
directory and ran svnserve -d
.
I was then able to git svn clone svn://127.0.0.1/test-svn -s
and it went perfectly. Then I stopped the svnserver and deleted the temporary svn repository.
这篇关于git svn迁移失败与svn 1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!