我正在尝试将一个项目从svn迁移到git。我使用osx软件包,但我也尝试用自制软件安装。我一直在犯同样的错误。
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
我在经营约塞米蒂。
发布于 2015-01-30 18:58:10
git svn
执行git-svn
,这是一个Perl程序,它使用libsvn的绑定,而这些绑定是敏感的。如果Perl更改或SVN更改,则可能导致分段错误。这两种情况都可能发生在操作系统升级中。
找出您的git使用的SVN绑定的哪个版本。这是我在OSX10.10.1上得到的
$ /usr/bin/git svn --version
git-svn version 1.9.3 (Apple Git-50) (svn 1.7.17)
试试@MykolaGurov在评论中建议的brew upgrade git
。似乎有修复10.10和git-svn。您还可以尝试brew reinstall subversion --with-perl
重新安装Perl绑定。
或者使用所提供的OS /usr/bin/git,它将使用操作系统提供的SVN和Perl构建。
或者尝试MacPorts,我使用它,它的git-svn工作。port install git +svn
。
发布于 2016-03-18 22:27:26
首先要做的是调试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
->通过自制升级git
。
brew升级git
如果Homebrew会抱怨文件冲突,那么运行:
brew链接--覆盖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
发布于 2021-02-08 09:58:52
我的案子不一样。我在https url中为我的svn回购指定了凭据。删除凭据解决了这个问题。
我是如何运行命令的
git svn https://<key>:<pass>@example.com/repo
移除键/传递和命令传递。
https://stackoverflow.com/questions/28228016
复制相似问题