The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,858 other subscribers

git svn broken on Mac OS X under SourceTree but not from the terminal: how to fix it.

Posted by jpluimers on 2016/07/05

Not on the terminal, but only in SourceTree I got this error (full text below):

Can't locate SVN/Core.pm in @INC

Well, the Xcode binaries were here:

 $ xcode-select -p
/Applications/Xcode.app/Contents/Developer

On Mavericks, perl is this version:

$ perl --version | grep -w for
This is perl 5, version 16, subversion 2 (v5.16.2) built for darwin-thread-multi-2level
(with 3 registered patches, see perl -V for more detail)

and git is this:

$ git --version
git version 1.9.5 (Apple Git-50.3)

Steps for fixing are at these blog entries:

All these solutions point you to change the system Perl installation, but since on my system it failed only on SourceTree, but from the terminal, I wanted to fix SourceTree.

So I started looking at the full error text:

Can't locate SVN/Core.pm in @INC (@INC contains: /usr/local/git/lib/perl5/site_perl /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2 /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
Compilation failed in require at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN.pm line 26.
BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN.pm line 33.
Compilation failed in require at /Applications/SourceTree.app/Contents/Resources/git_local/libexec/git-core/git-svn line 25.
BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/libexec/git-core/git-svn line 25.

Then decided this likely was the fix:

ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.16/darwin-thread-multi-2level/SVN /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level/SVN
ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.16/darwin-thread-multi-2level/auto/SVN/ /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level/auto/SVN

The second line fixes the error left after the first line:

Can't locate loadable object for module SVN::_Core in @INC (@INC contains: /usr/local/git/lib/perl5/site_perl /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2 /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level/SVN/Base.pm line 59.
BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level/SVN/Core.pm line 5.
Compilation failed in require at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
Compilation failed in require at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN.pm line 26.
BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/lib/perl5/site_perl/Git/SVN.pm line 33.
Compilation failed in require at /Applications/SourceTree.app/Contents/Resources/git_local/libexec/git-core/git-svn line 25.
BEGIN failed--compilation aborted at /Applications/SourceTree.app/Contents/Resources/git_local/libexec/git-core/git-svn line 25.

–jeroen

4 Responses to “git svn broken on Mac OS X under SourceTree but not from the terminal: how to fix it.”

  1. Warren Postma's avatar

    Warren Postma said

    So you’re effectively monkey patching the embedded git version inside SourceTree? You can just turn off “use internal git” on SourceTree can’t you?

    • jpluimers's avatar

      jpluimers said

      I’ve had issues with using the non-embedded hg and git versions understanding flow in the past so I’ve learned to let SourceTree very much likes the embedded hg/git versions.

      • WarrenP's avatar

        WarrenP said

        I haven’t even used git flow but the embedded system didn’t pick up the correct ssh keys and certificate authorities (CA) causing me to have lots of pain with the embedded one.

Leave a reply to jpluimers Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.