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 under Windows XP, and the error I get is:

  • How to create a Team Project in TFS from a mac machine?
  • GIT SHA id of a file on remote git branch
  • Why isn't the pathspec magic :(exclude) excluding the specified files from git log's output?
  • Unity meta files and git branching
  • In Git is there a way (or tool) to merge by comparing changes, not files?
  • Jenkins and updating git submodules
  • $ git svn 
    git: 'svn' is not a
    git-command. See 'git --help'.
    Did you mean one of these?

  • Can't Push Commits to Central Repository
  • Find out where a GitHub repo was forked from
  • Giving priority to GIT in GIT/SVN mixed project in Netbeans?
  • git push --atomic - Not failing
  • Checkout old commit to temporary directory with git
  • Git Push: What is the difference between HEAD:refs/heads/<branch> and <branch>?
  • 10 Solutions collect form web for “git-svn not a git command?”

    I am not sure that git svn has ever worked with recent Git Windows distribution (post 1.5.6).

    Many problems have been reported before, so git svn may very much be not included in current msysGit releases.

    Another current active “Git on Windows” development mingw.git does state in its README that svn does not work.

    This thread of Msysgit does suggest that git svn may be reintegrated at some points, but progress are still slow.

    Update: from MSysGit1.6.2 (early March 2009), git-svn works again. See this SO question.

    I just check on my newly installed ubuntu box and it wasn’t installed even with git-core installed. A simple:

    sudo apt-get install git-svn

    or your distro equivalent should fix it.

    On Ubuntu:

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

    I had the same error under Cygwin 1.7. It was solved by installing the git-svn package with Cygwin setup.

    Under my system I’ve had this trouble:

    $ git svn
    Can't locate SVN/ in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.0
    /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.

    For posterity: On CentOS 7, just run sudo yum install git-svn.

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

    If git-svn is not part of mSysGit, I recommend using a small UNIX server to host your gateway repository that clones your svn repository, and then clone that repository onto your Windows machine. This is the approach I am using for interacting with CVS from git.

    Had a similar problem on RHEL6

    Can’t locate Git/ 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.

    My solution:

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

    MacPorts version:

    port install git +svn

    (Note: you likely need to port deactivate git first)

    Git Baby is a git and github fan, let's start git clone.