git-svn on Windows (cygwin)

Up­date 2008-10-10: Often perl will not work due to mem­ory-remap­ping prob­lems. A so­lu­tion can be found in my ar­ti­cle about the issue.

What I re­ally love about Git is the fact that it nicely in­te­grates with ex­ist­ing Sub­ver­sion repos­i­to­ries. At our com­pany, we are using Sub­ver­sion as our SCM, but I per­son­ally like Git more and I want to use it as a side tool for more flex­i­ble branch­ing, merg­ing, and for check­ing in ver­sions I wouldn’t check in the shared repos­i­tory.

Git is sup­plied with git-svn, which can im­port an ex­ist­ing SVN repos­i­tory and also com­mit back to it. Under cyg­win, you need to per­form two ad­di­tional steps for get­ting git-svn to work, oth­er­wise it is likely to fail with “failed to in­clude Error.​pm”.

You need to down­load Error.​pm from CPAN. You have to save it to <cyg­win-dir>\lib\perl5\Error.​pm

Voila! git-svn should work now.

6 thoughts on “git-svn on Windows (cygwin)”

  1. I’ve installed git in cygwin both from setup.exe and then from source. I have subversion-perl installed. I copied down Error.pm as described above. I ran ash rebaseall as described elsewhere.

    git-svn is still nowhere to be found in cygwin.

    I get “git-svn: command not found”

    what am I doing wrong?

  2. Hi,

    verify if there is [cygwindir]\bin\git-svn available on your system. By default it should be installed together with the normal git package of cygwin.

    Also try entering /bin/git-svn if it can be found. Other git operations are working?

    Best regards,
    Martin

  3. The command is not git-svn, its ‘git svn’. If you install what is above you should be able to get ‘git help svn’ to show you the man page for it.

  4. wow. I knew I must’ve been doing something stupid!
    looks like I do have “git svn” command available.

    thanks for helping a noob guys!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.