我想一起使用SVN和Git。我有一个svn信息库,并且试图获取一个工作目录,但是遇到如下错误。
svn,版本1.6.6(r40053)
git版本1.7.3.1.msysgit.0
svn存储库路径为文件:/// d:/ tmp / test-svn / repos
这些是我执行的步骤:
D:\tmp\test-svn>mkdir my-project
D:\tmp\test-svn>cd my-project
D:\tmp\test-svn\my-project>git svn init file:///d:/tmp/test-svn/repos
Initialized empty Git repository in D:/tmp/test-svn/my-project/.git/
D:\tmp\test-svn\my-project>git svn fetch
Couldn't open a repository: Unable to open an ra_local session to URL: Unable to
open repository 'file:///d:/tmp/test-svn/repos/my-project/trunk': Expected FS f
ormat '2'; found format '4' at C:\Program Files\Git/libexec/git-core/git-svn lin
e 1773
那是什么问题呢?如何从svn存储库中获取数据到git工作目录?
谢谢。
最佳答案
我认为这是以下问题:http://code.google.com/p/msysgit/issues/detail?id=298
可能的解决方案是设置svnserve并使用svn://
协议(protocol)而不是file:///
有关在Windows上设置svnserve的信息,请参见此处:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup-svnserve.html
更新
如果您使用Windows操作系统,则svnserve
可作为TortoiseSVN的一部分使用(我已通过TortoiseSVN 1.8.6版进行了检查)
然后,您就可以开始:
svnserve -d -R --root c:\path\to\svn\repo
并使用以下命令克隆存储库:
git svn clone svn://localhost/path/inside/svn/repo