I upgraded from OS X Mavericks to Yosemite and my git svn broke as a result.
I use Git and Subversion both in my development. Some Git repositories link up to Subversion repositories which I then push to Git and commit to Subversion using
git svn dcommit.
The Problem with git svn in Yosemite
I usually just use the Terminal for command line for Git. Running git svn command gave me this error:
Can’t locate SVN/Core.pm in @INC (you may need to install the SVN::Core module)
Along with that some paths of what INC contains.
The main and only requirement that I had to do was to update my XCode in OS X to ensure that I have the latest command line tools, that’s all. XCode is large but you may struggle trying to link up an older version of SVN in XCode with a newer version of SVN in the Perl on your Mac OS X. Yosemite comes with Perl 5.18 (5.18.2 at the time of writing this article.).
If you don’t want to install the full Xcode package, see Mac OS X: Installing Command Line Tools without Xcode. It is much quicker and includes the SVN package.
You need to link up your SVN correctly using this command:
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/SVN /System/Library/Perl/Extras/5.18/SVN
git svn again and you’ll get a different error:
Can’t locate loadable object for module SVN::_Core in @INC
We’re making some progress now. The Subversion core is found since you linked it up but some other objects cannot be found. So run this command:
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN/ /System/Library/Perl/Extras/5.18/auto/SVN
And that’s it, run
git svn again and you’ll see something like this:
Antonies-MacBook-Pro:newsletters-lite contrid$ git svn
git-svn – bidirectional operations between a single Subversion tree and git
usage: git svn
That is, if you’re inside a working Git directory. Either way, you’ll notice that it works.