【问题标题】:git svn migration failing with svn 1.8svn 1.8 的 git svn 迁移失败
【发布时间】:2014-12-02 01:31:43
【问题描述】:

我正在执行以下步骤: http://git-scm.com/book/en/v2/Git-and-Other-Systems-Git-as-a-Client

将 svn 存储库移动到 git。我本地的svn版本是:

$ svn --version svn, version 1.8.10 (r1615264) compiled Aug 25 2014, 10:52:18 on x86_64-apple-darwin12.5.0

git 版本:

$ git --version git version 2.1.0

当我克隆存储库时,读取本地文件系统格式时出错:

$ 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

根据这个 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 升级到最新的 2.2 版本,但仍然遇到同样的错误。

标签: git svn version-control osx-lion


【解决方案1】:

我在 git-users 电子邮件列表上得到了答复。

解决方法是运行本地svnserver,在运行git svn clone时使用svn协议,而不是file协议。这避免了git-svn 需要解析 svn 1.8 文件格式。

假设您的存储库位于/path/to/repository/test-svn 目录中。切换到/tmp目录并运行

svnserve -d -r /path/to/repository

然后就可以运行了

git svn clone svn://127.0.0.1/test-svn -s

之后,停止 svnserver 并删除临时 svn 存储库。

【讨论】:

  • cdtest-svn 的父目录(或任何你的 SVN 存储库被称为 - 我正在使用那个例子)。然后运行svnserve -d --foreground -r .。你的 repo URL 现在是svn://localhost/test-svn
猜你喜欢
  • 1970-01-01
  • 2015-07-11
  • 2010-11-05
  • 1970-01-01
  • 1970-01-01
  • 2021-09-30
  • 2012-02-19
  • 2018-11-08
  • 1970-01-01
相关资源
最近更新 更多