So I Installed git and git-svn on Cygwin

Sometime I’ll have to tell you about why I chose git.

Installing on cygwin wasn’t too bad. Had a few problems, though.

A little background

  • git is an open source, distributed version control system, originally created by Linus Torvalds, and greatly enhanced by the open source community.
  • svn or Subversion is an open source, centralized version control system.
  • git-svn is a git command to let you use the distributed functionality of git, and interact with the centralized world of subversion.

Cygwin setup

Running cygwin’s setup program gives you a GUI package installer. I like to use the xmission mirror, both because it is geographically close by, and because it is fast.

After all the preliminaries, click the “View” button to get an alphabetical list of packages, and expand the window so you can see a bit more. (I’m SO grateful cygwin finally made the window expandable, that I feel a bit guilty complaining that the initial window size is still too small…)

You’ll need at least the git, gitk, perl, and subversion-perl packages, and there’s lots of other good stuff there, too – like a full x.org X-Windows system.

These required packages will also install a lot of other dependencies, so be prepared to wait a bit while it downloads and installs everything.

Download Error.pm

I also needed to download Error.pm from CPAN into my c:/cygwin/lib/perl5/site_perl/5.10/ directory. (Thanks, Martin Carpella!)

Run git-svn

After everything is installed, you should be able to run git-svn. Note that there are two ways to run git-svn:

  1. git svn runs the wrapper program (git) which spawns the svn submodule
  2. git-svn runs the svn submodule directly

The installation process put git in /bin and git-svn in /usr/sbin/git-core/. I didn’t want to add that directory to my path, so I just run git svn.

Using git-svn

Andy Delcambre describes a basic workflow to use git-svn. There’s a more detailed description on git.or.cz

Some Problems

  • subversion-perl or perl not installed. Use the cygwin setup program.
    git: 'svn' is not a git-command. See 'git --help'.
  • Perl not found or not installed (I reinstalled perl using the cygwin setup program):
    /usr/sbin/git-core/git-svn: /usr/bin/perl: bad interpreter: No such file or directory
  • Need to download Error.pm, or need to place it in the @INC path:
    Can't locate Error.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/5.10/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at /usr/lib/perl5/vendor_perl/5.10/Git.pm line 100.

Leave a Comment