On OSX using sourcetree / git-svn getting “Can't locate SVN/Core.pm in @INC ”

前端 未结 10 2122
离开以前
离开以前 2021-02-07 06:14

I\'m using OSX and want get a svn repo into a local git repo using sourcetree.

When I add a bookmark using sourcetree using SVN URL, thus sourcetree<

相关标签:
10条回答
  • 2021-02-07 07:03

    I've found that the best solution is to expand the list of directories in @INC using an export

    export PERL5LIB=/Applications/Xcode.app/Contents/Developer/Library/Perl/5.18
    

    Referenced from: https://perlmaven.com/how-to-change-inc-to-find-perl-modules-in-non-standard-locations

    0 讨论(0)
  • 2021-02-07 07:05

    Plus to the highest answer, If you are using souceTree, simply paste command line may not work immediately. In that case, you may need to check git used in your sourceTree, which should be set as System git.

    0 讨论(0)
  • 2021-02-07 07:11

    Or, if you don't have Xcode, just CommandLineTools (this is on ElCapitan 10.11.6):

    sudo ln -s /Library/Developer/CommandLineTools/Library/Perl/5.18/darwin-thread-multi-2level/SVN /usr/local/git/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/SVN
    sudo ln -s /Library/Developer/CommandLineTools/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN /usr/local/git/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/auto/SVN
    

    If you previously linked some older version or just made a mistake so it gives you: File exists, then you should first do

    sudo unlink /usr/local/git/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/SVN
    

    for whichever file was reported as already existent, of course.

    EDIT Dir doesn't exist: (suggested by @rogeriopradoj)

    mkdir -p /usr/local/git/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level
    

    EDIT Sierra:
    After upgrading to Sierra I lost CommandLineTools, so I just had to reinstall it and everything was back to normal.
    This will prompt you to install just the CommandLineTools, not the whole XCode.

    xcode-select --install

    Hope this helps someone :)

    0 讨论(0)
  • 2021-02-07 07:11

    The solution for me was to delete the password entry in the OSX key ring app, and have git svn re-create it. My key entry has been created earlier (by svn I suppose), and it seems that git cannot use this key entry (nor fix it nor add a second one).

    The long story: I noticed that when unsing "system git" in SourceTree, there seemed to be a problem storing the credentials. When I entered the same git command (that SourceTree is issuing) on the command-line, git kept prompting me for my password each time.

    Then I found https://stackoverflow.com/a/39800112/580672

    If you are interested, my setup was:

    • No Xcode, only Command-Line tools (so I adapted the paths as mentioned in a post above ( https://paulschreiber.com/blog/2015/11/09/fixing-git-svn-on-os-x-el-capitan/comment-page-1/#comment-437843 )
    • Homebrew has svn and perl installed

    I had tried with no success:

    • "embedded git" (yields the @INC error)
    • "system git" (different error: "Username: Use of uninitialized value $ret in chomp at /usr/local/Cellar/git/2.21.0/share/perl5/Git.pm line 596.")
    • put usr/bin in front of my PATH as suggested above
    • force-uninstalled perl in homebrew

    All without success. The solution was system git and the key entry, as stated above.

    0 讨论(0)
提交回复
热议问题