SourceTree是mac下非常好用的git客户端,当然也支持svn。SourceTree导入svn库的时候会转成git库存在本地。 在操作的时候,报的错误如下: Can’t locate SVN/Core.pm in @INC (@INC contains: /usr/local/Cellar/git/1.8.4.1/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level /usr/local/Cellar/git/1.8.4.1/lib/perl5/site_perl/5.16.2 /usr/local/Cellar/git/1.8.4.1/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 /usr/local/Cellar/git/1.8.4.1/lib/perl5/site_perl/Git/SVN/Utils.pm line 6. BEGIN failed–compilation aborted at /usr/local/Cellar/git/1.8.4.1/lib/perl5/site_perl/Git/SVN/Utils.pm line 6. Compilation failed in require at /usr/local/Cellar/git/1.8.4.1/lib/perl5/site_perl/Git/SVN.pm line 26. BEGIN failed–compilation aborted at /usr/local/Cellar/git/1.8.4.1/lib/perl5/site_perl/Git/SVN.pm line 33. Compilation failed in require at /usr/local/Cellar/git/1.8.4.1/libexec/git-core/git-svn line 25. BEGIN failed–compilation aborted at /usr/local/Cellar/git/1.8.4.1/libexec/git-core/git-svn line 25. 从上面可以看出是找不到svn的相关信息。经查资料,解决方法如下: 首先确定CommandLineTools是单独安装的,还是通过Xcode安装的。 如果是单独安装的,执行如下命令:
1 |
sudo ln -s /Library/Developer/CommandLineTools/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/ |
1 |
sudo ln -s /Library/Developer/CommandLineTools/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/ |
如果是通过Xcode安装的,执行:
1 |
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/ |
1 |
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/ |
再次执行导入,就可以享受SourceTree带来的便利了。
上面提到的perl下的版本号,要根据实际情况确定。sourcetree报错的里面,应该就可以看到具体的版本号。
按照你说的做了,还是还是报同样的错误哦
直接在terminal用git svn clone是可以的