Posts Tagged svn

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!

, ,