【问题标题】:git svn clone died of signal 11 on OSXgit svn clone 在 OSX 上死于信号 11
【发布时间】:2021-02-08 17:58:52
【问题描述】:

我正在尝试将项目从 svn 迁移到 git。我使用的是 osx svn 包,但我也尝试使用自制软件安装。我不断收到同样的错误。

git svn clone http://myserver/myrepo
error: git-svn died of signal 11

版本信息:

git --version
git version 2.2.1

svn --version
svn, version 1.7.17 (r1591372)
   compiled Sep 18 2014, 13:06:44

我正在经营优胜美地。

【问题讨论】:

  • 我建议卸载这些,然后下载具有 git 和 svn 的相当新版本的 XCode。
  • 如果您在升级到优胜美地之前通过 brew 安装了 git,您可能需要通过 brew (brew upgrade git) 更新您的 git 安装 - 有 yosemite-related fixes in brew
  • git svn --version 说什么?您必须在 git 存储库中执行此操作,不管是哪个。

标签: git svn git-svn osx-yosemite


【解决方案1】:

git svn 执行git-svn,这是一个使用绑定到 libsvn 的 Perl 程序,这些绑定很敏感。如果 Perl 更改或 SVN 更改,则可能导致段错误。两者都可能发生在操作系统升级中。

找出您的 git 使用的 SVN 绑定版本。这是我在 OS X 10.10.1 上得到的结果

$ /usr/bin/git svn --version
git-svn version 1.9.3 (Apple Git-50) (svn 1.7.17)

按照 @MykolaGurov 在 cmets 中的建议尝试 brew upgrade git。好像有fixes for 10.10 and git-svn。您也可以尝试brew reinstall subversion --with-perl 重新安装 Perl 绑定。

或者使用 OS X 提供的 /usr/bin/git,它将使用 OS 提供的 SVN 和 Perl 构建。

或者尝试MacPorts,我使用它并且它的 git-svn 工作。 port install git +svn.

【讨论】:

  • 在升级 git 后重新安装 Perl 绑定就像一个魅力。谢谢!
  • brew upgrade gitbrew reinstall subversion --perl 为我工作
  • OS X 升级后:如果brew upgrade git 表示已安装最新版本,但您仍然收到signal 11,请尝试brew uninstall git,然后使用brew install git 重新安装。
  • 从重新安装subversion时的日志:subversion: --perl was deprecated; using --with-perl instead!.
  • --perl/--with-perl 似乎不再是有效选项。
【解决方案2】:

首先要做的是调试git 命令,通过添加GIT_TRACE=1 来查看它在哪个组件上失败,例如

$ GIT_TRACE=1 git svn clone https://example.com/svn/foo/ foo
21:12:40.239238 git.c:557               trace: exec: 'git-svn' 'clone' 'https://example.com/svn/foo/ foo/' 'foo'
21:12:40.240158 run-command.c:347       trace: run_command: 'git-svn' 'clone' 'https://example.com/svn/foo/ foo/' 'foo'
error: git-svn died of signal 11

并重新运行损坏的存储库中的最后一个命令,这表明崩溃发生在 git-svn 二进制文件中。

为此,您需要确定 git-svn 二进制文件的位置,例如

$ which -a git-svn
$ locate git-svn | grep git-svn$
/Applications/GitHub.app/Contents/Resources/git/libexec/git-core/git-svn
/Applications/SourceTree.app/Contents/Resources/git_local/libexec/git-core/git-svn
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn
/Library/Developer/CommandLineTools/usr/libexec/git-core/git-svn
/usr/local/libexec/git-core/git-svn
/usr/local/Cellar/git/1.8.4.1/libexec/git-core/git-svn
/usr/local/Cellar/git/2.4.0/libexec/git-core/git-svn

如果您有多个 git-svn 二进制文件,要找出使用的是哪一个,请运行:

sudo fs_usage -f exec | grep git

在另一个终端再次运行失败的 git 命令之前。

一旦你确定了你运行的是哪个git-svn,就直接运行它:

/usr/local/libexec/git-core/git-svn ...
/usr/local/Cellar/git/2.4.0/libexec/git-core/git-svn 

而且不管你指定哪个参数,它很可能会崩溃,否则按照跟踪输出中所示的方式指定。

有时它可能是一个符号链接,因此请检查它指向的位置,例如:

$ stat /usr/local/libexec/git-core/git-svn
  File: ‘/usr/local/libexec/git-core/git-svn’ -> ‘/Applications/GitHub.app/Contents/Resources/git/libexec/git-core/git-svn’

如果是这种情况,请将符号链接更改为不会崩溃的链接,例如

$ ln -vfs /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn /usr/local/libexec/git-core/git-svn 
‘/usr/local/libexec/git-core/git-svn’ -> ‘/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn’

或者确定您的git-svn 属于哪个包并相应升级,例如

  • /Applications/Xcode.app -> 升级 Xcode,
  • /Applications/GitHub.app -> 升级 GitHub 应用
  • /usr/local/Cellar/git -> 通过 Homebrew 升级 git,例如

    brew upgrade git
    

    如果 Homebrew 会抱怨文件冲突,那么运行:

    brew link --overwrite git
    

如果升级后仍然崩溃,请使用不会崩溃的其他版本(如上所述),例如

/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn clone https://example.com/svn/foo/ foo

如果这对您有用,请添加到您的 PATH 并稍后使用 git-svn 命令,或添加别名,例如:

alias git-svn='/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-svn'

如果新的git-svn 缺少任何依赖项,请运行以下命令安装Git::SVN

sudo cpan install Git::SVN

调试

如果上面没有帮助,您可以进一步调试它。以下是一些建议在单独的终端中运行,然后运行失败的命令:

sudo dtruss -fn git

或:

sudo dtruss -fn git-svn

要确定调用了哪个git-svn,您可以尝试:

  • sudo /usr/bin/newproc.d
  • sudo fs_usage -f exec | grep git

【讨论】:

    【解决方案3】:

    我的情况不同。我在我的 svn 存储库的 https url 中指定了凭据。 删除凭据解决了这个问题。

    我是如何运行命令的

    git svn https://<key>:<pass>@example.com/repo
    

    删除键/密码,命令通过。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-17
      • 1970-01-01
      • 1970-01-01
      • 2017-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多