Git SVN无法从SVN存储库中获取 [英] Git SVN Is Unable to Fetch from SVN Repository

查看:148
本文介绍了Git SVN无法从SVN存储库中获取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一起使用SVN和Git。我有一个svn仓库,我试图抓取一个工作目录,但是我遇到了如下的错误。



svn,版本1.6.6 (r40053)

git 1.7.3.1.msysgit.0

svn版本库路径是 file:/// d:/tmp/test-svn/repos

这些步骤是我的did:

  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

在D中初始化的空Git仓库:/tmp/test-svn/my-project/.git/

D:\ tmp \ test-svn\my-project> git svn fetch

无法打开存储库:无法打开ra_local会话到URL:无法打开存储库
文件:/// d:/ tmp / test-svn / repos / my-project / trunk':预期的FS f
ormat'2';在C:\\ Program Files \Git / libexec / git-core / git-svn lin找到格式'4'
e 1773

那么问题是什么?如何从svn仓库获取数据到git工作目录?

谢谢。

解决方案

我认为这是以下问题: http: //code.google.com/p/msysgit/issues/detail?id=298



可能的解决方案是设置svnserve并使用 svn:// 协议而不是 file:///



在这里看到在Windows上设置svnserve:
http:// tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup-svnserve.html



更新



svnserve 可作为TortoiseSVN的一部分,如果您使用Windows操作系统(我使用TortoiseSVN 1.8.6版进行检查)



然后你就开始:

  svnserve -d -R --root c:\\ \\ path \to\svn\repo 

并使用以下命令克隆存储库:

  git svn克隆svn:// localhost / path / inside / svn / repo 


I'd like to use SVN and Git together. I have an svn repository, and I'm trying to fetch to a working directory, but I encounter an error as below.

svn, version 1.6.6 (r40053)

git version 1.7.3.1.msysgit.0

The svn repository path is file:///d:/tmp/test-svn/repos

These are the steps I did:

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

So what is the issue? How can I fetch data from svn repository to the git working directory?

Thank you.

解决方案

I think this is the following issue: http://code.google.com/p/msysgit/issues/detail?id=298

Possible solution is to setup svnserve and use the svn:// protocol instead of file:///

See here for setting up svnserve on Windows: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup-svnserve.html

UPDATE

svnserve is available as a part of TortoiseSVN if you use Windows OS (I checked with TortoiseSVN version 1.8.6)

Then you just start:

svnserve -d -R --root c:\path\to\svn\repo

and clone the repository with following command:

git svn clone svn://localhost/path/inside/svn/repo

这篇关于Git SVN无法从SVN存储库中获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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