git-svn 不是 git 命令?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/527037/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git-svn not a git command?
提问by Cristián Romo
While attempting to get an old svn dump of a project under git control, I ran into an interesting problem. Whenever I run git svn
, I get an error saying it isn't a git command, yet there is documentation for it that I can pull up using git help
. Is there something wrong with my install, or am I just missing something here?
在尝试获取 git 控制下的项目的旧 svn 转储时,我遇到了一个有趣的问题。每当我运行时git svn
,我都会收到一条错误消息,指出它不是 git 命令,但我可以使用git help
. 我的安装有问题吗,或者我只是在这里遗漏了什么?
Edit: I should probably also mention that I am running msysGit version 1.6.1.9.g97c34 under Windows XP, and the error I get is:
编辑:我可能还应该提到我在 Windows XP 下运行 msysGit 版本 1.6.1.9.g97c34,我得到的错误是:
$ git svn git: 'svn' is not a git-command. See 'git --help'. Did you mean one of these? fsck show
采纳答案by VonC
I am not sure that git svn has ever workedwith recent Git Windows distribution (post 1.5.6).
我不确定git svn 是否曾经使用过最近的 Git Windows 发行版(1.5.6 后)。
Many problems have been reportedbefore, so git svn
may very much be not included in current msysGit releases.
之前已经报告了许多问题,因此git svn
可能没有包含在当前的 msysGit 版本中。
Another current active "Git on Windows" development mingw.gitdoes state in its READMEthat svn does not work.
另一个当前活跃的“Windows 上的 Git”开发mingw.git在其自述文件中声明 svn 不起作用。
This thread of Msysgitdoes suggest that git svn may be reintegrated at some points, but progress are still slow.
Msysgit 的这个线程确实表明 git svn 可能会在某些时候重新集成,但进展仍然缓慢。
Update: from MSysGit1.6.2 (early March 2009), git-svn
works again. See this SO question.
更新:来自 MSysGit1.6.2(2009 年 3 月上旬),git-svn
再次工作。看到这个问题。
Update: with a modern (2017) Git for Windows 2.x, git svn
is already included.
No need for sudo apt-get install git-svn
, which would only be possible in a WSL (Windows Subsystem for Linux) shell sessionanyway.
更新:用现代(2017年)的Git为Windows 2.x中,git svn
已经包含。
不需要sudo apt-get install git-svn
,无论如何这只能在WSL(Linux 的 Windows 子系统)shell 会话中实现。
回答by hacintosh
I just check on my newly installed ubuntu box and it wasn't installed even with git-core installed. A simple:
我只是检查了我新安装的 ubuntu 盒子,即使安装了 git-core,它也没有安装。一个简单的:
sudo apt-get install git-svn
or your distro equivalent should fix it.
或者你的发行版等价物应该修复它。
回答by alexsaintx
On Ubuntu:
在 Ubuntu 上:
sudo add-apt-repository ppa:git-core/ppa
apt-get update
sudo apt-get install git-svn
回答by jfsantos
Under my system I've had this trouble:
在我的系统下,我遇到了这个问题:
$ git svn
Can't locate SVN/Core.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.0
/usr/lib/perl5/5.10.0/i486-linux-thread-multi
/usr/lib/perl5/5.10.0
/usr/lib/perl5/site_perl/5.10.0/i486-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.10.0/i486-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl .) at
/usr/libexec/git-core/git-svn line 29.
because I don't have Subversion Perl bindings installed. Try installing them and running the command again.
因为我没有安装 Subversion Perl 绑定。尝试安装它们并再次运行命令。
回答by Dave Gregory
For posterity: On CentOS 7, just run sudo yum install git-svn
.
对于后代:在 CentOS 7 上,只需运行sudo yum install git-svn
.
回答by Esko Luontola
I had the same error under Cygwin 1.7. It was solved by installing the git-svn package with Cygwin setup.
我在 Cygwin 1.7 下有同样的错误。它是通过使用 Cygwin 安装程序安装 git-svn 包来解决的。
回答by user1012316
On Gentoo , you should build git with USE="subversion"
在 Gentoo 上,您应该使用 USE="subversion" 构建 git
回答by Rob
Had a similar problem on RHEL6, i.e.,
在 RHEL6 上有类似的问题,即,
Can't locate Git/SVN.pm in @INC (@INC contains: /usr/local/share/perl5 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/libexec/git-core/git-svn line 25.
在@INC 中找不到 Git/SVN.pm(@INC 包含:/usr/local/share/perl5 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl / usr/lib64/perl5 /usr/share/perl5 .) 在 /usr/local/libexec/git-core/git-svn 第 25 行。
My solution:
我的解决方案:
sudo yum install subversion-perl
chmod 755 /usr/local/share/perl5/ (and sub dirs, as they were only readable by root)
回答by merv
MacPorts version:
MacPorts 版本:
port install git +svn
(Note: you likely need to port deactivate git
first)
(注意:您可能需要port deactivate git
先)
回答by drkvogel
It wasn't installed on my fresh install of Ubuntu on WSL -
它没有安装在我在 WSL 上全新安装的 Ubuntu 上 -
sudo apt install git-svn
sorted it:
排序它:
? git svn
git-svn - bidirectional operations between a single Subversion tree and git
...