Getting git-svn to run on OS X

I've been gitting into git (clever, I know) lately, so I was trying to migrate my git commits for a project back into an existing subversion repository - another post coming on that later.

When trying to run git-svn to import my subversion repository into git I got the following error, followed by a Perl stack trace:

Can't locate Term/ReadKey.pm

A couple of installs got this working, read on...

Install Term::ReadKey

To install Term::ReadKey, fire up a terminal and type (you may need to sudo):

$> perl -MCPAN -e shell
cpan> install Term::ReadKey

After a bunch of output I got the error message:

Writing Makefile for Term::ReadKey
    -- NOT OK
Running make test
  Can't test without successful make
Running make install
  make had returned bad status, install seems impossible

I tried to see what was wrong with the Makefile by trying to run make in the TermKey folder:

~/.cpan/build/TermReadKey-2.30 $> make
-bash: make: command not found

Interesting, didn't realize OS X came preinstalled with things like perl but not make.

Getting make on OS X

I'm sure there's an easier way to just get make on OS X, but I'm still new to my mac, so I wanted to install something supported by Apple instead of getting into stuff like ports. After searching around on the Developer center I found that XCode includes make.

After signing up for a free developer account and installing XCode, I now had make.

Installing Term::ReadKey - round 2

Let's try this again...

$> perl -MCPAN -e shell
cpan> install Term::ReadKey

CPAN: Storable loaded ok
Going to read /Users/greg/.cpan/Metadata
  Database was generated on Wed, 10 Dec 2008 11:26:54 GMT
Term::ReadKey is up to date.

Hurray! Now git-svn is working on OS X.

Other relevant Mac/Git links:

Author image

About Greg Jastrab

You've successfully subscribed to SmartLogic Blog
Great! Next, complete checkout for full access to SmartLogic Blog
Welcome back! You've successfully signed in.
Unable to sign you in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.