git-svn not a git command?

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?

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:

$ git svn
git: 'svn' is not a
git-command. See 'git --help'.


Did you mean one of these?
fsck
show
75903 次浏览

在我的系统里,我遇到了这样的麻烦:

$ 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.

因为我没有安装 Subversion Perl 绑定。请尝试安装它们并再次运行该命令。

我刚刚检查了我新安装的 ubuntu 系统,它甚至没有安装 git-core:

sudo apt-get install git-svn

或者你的发行版本应该修复它。

我不确定 Git Svn 曾经工作过与最近的 Git Windows 发行版(后1.5.6)。

之前有很多问题 已经被报道了,所以 git svn可能不包含在当前的 msysGit 版本中。

另一个当前活跃的“ Git on Windows”开发 混蛋在其 自述中声明 svn 不能工作。

这个 Msysgit 之线确实表明 git svn 可能在某些时候被重新集成,但是进展仍然很慢。


更新: 来自 MSysGit1.6.2(2009年3月初) ,git-svn又能用了


更新: 对于 用于 Windows2.x 的现代(2017) Gitgit svn已经包含在内。
不需要 sudo apt-get install git-svn,这只有在 WSL (Linux 的 Windows 子系统) shell 会话中才有可能。

如果 git-svn 不是 mSysGit 的一部分,我建议使用一个小型 UNIX 服务器托管网关存储库,这个存储库可以克隆 svn 存储库,然后将该存储库克隆到 Windows 机器上。这就是我用于从 git 与 CVS 交互的方法。

我在 Cygwin 1.7下也有同样的错误,通过安装带有 Cygwin 设置的 git-svn 包解决了这个问题。

On Gentoo , you should build git with USE="subversion"

在 Ubuntu 上:

sudo add-apt-repository ppa:git-core/ppa
apt-get update
sudo apt-get install git-svn

Had a similar problem on RHEL6, i.e.,

无法在@INC 中找到 Git/SVN.pm (@INC 包含:/usr/local/share/perl5/usr/local/lib64/perl5/usr/lib64/perl5/ 贩卖者 _ perl/usr/share/perl5/贩卖者 _ perl/usr/lib64/perl5/usr/share/perl5.) ,地址是/usr/local/libexec/Git-core/Git-svn 第25行。

我的解决办法是:

sudo yum install subversion-perl
chmod 755  /usr/local/share/perl5/ (and sub dirs, as they were only readable by root)

对于子孙后代: 在 CentOS 7上,只需运行 sudo yum install git-svn

MacPorts version:

port install git +svn

(注意: 您可能需要首先 port deactivate git)

在 Fedora 上,我不得不安装它

sudo dnf install -y git-svn

我在 CentOS 上用过

sudo yum install git-svn

它没有安装在我新安装的 Ubuntu 的 WSL-

sudo apt install git-svn

分类:

❯ git svn
git-svn - bidirectional operations between a single Subversion tree and git
...