Using git svn on OS X 10.8 Developer Preview

After installing the OS X 10.8 Mountain Lion Developer Preview I noticed that while git and svn both worked independently, I started receiving the following error trying to use git svn:

Can't locate SVN/ in @INC (@INC contains: /Applications/ /usr/../Library/Perl/5.12/darwin-thread-multi-2level /usr/share/git-core/perl /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /usr/libexec/git-core/git-svn line 61.

It turns out the path for the svn perl library has moved as part of the Xcode 4.4 restructuring. Since most package managers like Homebrew or MacPorts may not work correctly on the 10.8 preview yet, and the CollabNet svn binary installer is also not updated, it’s easiest to continue using the versions of git and svn bundled with the Xcode 4.4 command line tools and adjust the perl include path to work with the new layout.

To do this:

  1. Ensure that the Xcode 4.4 command line tools are installed (this is now done from within Xcode under Preferences -> Downloads -> Components).
  2. Add the following environment variable (or append to it as needed if you’re already setting it elsewhere):
    export PERL5LIB="/Applications/"

After this git svn should work correctly again!

, ,

  1. #1 by Mistunk on July 25, 2012 - 2:36 pm

    Thanks you this was useful for me !

  2. #2 by blogging system on October 1, 2014 - 8:00 am

    I like the helpful information you provide for your articles.

    I’ll bookmark your blog and check again right here regularly.
    I am quite certain I will be told a lot of new stuff right right here!
    Best of luck for the following!

  3. #3 by je clique on January 28, 2015 - 7:30 pm

    Prettty section of content. I just stumbled upon your
    web site and in accession capital too say thhat I get iin fact loved accoint your
    blog posts. Anyy way I’ll be subscribing
    in your feeds or even I fulfillment you get admission to consistently rapidly.

(will not be published)