Git SVN 无法从 SVN 存储库获取

发布于 2024-10-18 22:05:58 字数 834 浏览 4 评论 0原文

我想同时使用 SVN 和 Git。我有一个 svn 存储库,我正在尝试获取工作目录,但遇到如下错误。

svn,版本 1.6.6 (r40053)

git 版本 1.7.3.1.msysgit.0

svn 存储库路径为 file:///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 工作目录?

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

感性不性感 2024-10-25 22:05:58

我认为这是以下问题: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

UPDATE

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

然后您只需开始:

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

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

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

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
不醒的梦 2024-10-25 22:05:58

我可以建议使用 SmartGit 克隆您的存储库。它具有用 java 实现的 git-svn 功能,它比 git-svn 快得多,并且性能优于它。希望它对你有用。

但是,如果您有权访问 SVN 存储库服务器,我建议您安装 SubGit 到其中。在这种情况下,您将获得一个自动与 SVN 存储库同步(并且并发安全)的 Git 存储库。

与 git-svn 相比,这两种方法都有很大的优势,例如:自动标记、忽略、EOL 翻译。 SubGit 还尝试在提交 SVN 时尽可能保留日期。

I can propose to clone your repository with SmartGit. It have git-svn functionality implemented in java, which is significantly faster than git-svn and outperforms it. Hope it will work for you.

But if you have an access to your SVN repository server I recommend you to install SubGit into it. In this case you will get a Git repository that is automatically synchronized with SVN repository (and concurrent-safe).

Both approaches has large advantages over git-svn like: automatical tags, ignores, EOLs translation. SubGit also tries to preserve dates as it is possible while committing to SVN.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文