升级Mac OS X 和 Xcode的SVN到最新版本
截至目前SVN最新版本已经到l.7.9 Release,而Xcode以及Mac系统自带的SVN版本还是1.6。实在不喜欢SVN1.6版本在每个目录下都生成一个.svn文件夹,所以动手自己来升级SVN。
1、下载最新版的Mac版SVN客户端
到http://www.wandisco.com下载最新的Mac版SVN客户端,地址:http://www.wandisco.com/subversion/download/thankyou?f=subversion-binaries%2F1.7%2FSubversion-1.7.9_10.8.x.pkg如果你的操作系统不是10.8请自己在下载页面选择一个合适的版本。
下载得到文件:Subversion-1.7.9_10.8.x.pkg。
2、安装最新版SVN客户端
点击刚才下载得到的文件开始安装,程序会安装到/opt/subversion下面。
3、替换Mac OS X自带的SVN客户端
使用如下命令可以找到Mac OS X自带的SVN客户端所在的目录
$whichsvn/usr/bin/svn
我们可以看一下这些文件
$ls/usr/bin/svn*/usr/bin/svn/usr/bin/svndumpfilter/usr/bin/svnrdump/usr/bin/svnsync/usr/bin/svnadmin/usr/bin/svnlook/usr/bin/svnserve/usr/bin/svnversion
接下来我们删除这些旧版本的SVN程序,如果你有点点不放心,建议备份一下。
$sudorm-rf/usr/bin/svn*
OK,接下来我们创建一些链接
$sudoln-s/opt/subversion/bin/svn*/usr/bin/
好了,我们已经升级成功了,检测一下,如果你看到下面的信息,恭喜你!
$svn--versionsvn,version1.7.9(r1462340)compiledApr32013,13:49:20Copyright(C)2013TheApacheSoftwareFoundation.Thissoftwareconsistsofcontributionsmadebymanypeople;seetheNOTICEfileformoreinformation.Subversionisopensourcesoftware,seehttp://subversion.apache.org/Thefollowingrepositoryaccess(RA)modulesareavailable:*ra_neon:ModuleforaccessingarepositoryviaWebDAVprotocolusingNeon.-handles'http'scheme-handles'https'scheme*ra_svn:Moduleforaccessingarepositoryusingthesvnnetworkprotocol.-withCyrusSASLauthentication-handles'svn'scheme*ra_local:Moduleforaccessingarepositoryonlocaldisk.-handles'file'scheme*ra_serf:ModuleforaccessingarepositoryviaWebDAVprotocolusingserf.-handles'http'scheme-handles'https'scheme
4、替换Xcode自带的SVN客户端
我之前以为Xcode直接调用操作系统自带的SVN客户端,更新了操作系统自带的SVN客户端之后,在Xcode里直接使用SVN,发现竟然还是1.6的!所以我们还需要升级Xcode的SVN客户端。
我当前Xcode版本是4.6.2,SVN客户端位于/Applications/Xcode.app/Contents/Developer/usr/bin/目录下
$ls/Applications/Xcode.app/Contents/Developer/usr/bin/svn*/Applications/Xcode.app/Contents/Developer/usr/bin/svn/Applications/Xcode.app/Contents/Developer/usr/bin/svnadmin/Applications/Xcode.app/Contents/Developer/usr/bin/svndumpfilter/Applications/Xcode.app/Contents/Developer/usr/bin/svnlook/Applications/Xcode.app/Contents/Developer/usr/bin/svnrdump/Applications/Xcode.app/Contents/Developer/usr/bin/svnserve/Applications/Xcode.app/Contents/Developer/usr/bin/svnsync/Applications/Xcode.app/Contents/Developer/usr/bin/svnversion
接下来我们删除这些旧版本的SVN程序,如果你有点点不放心,建议备份一下。
$sudorm-rf/Applications/Xcode.app/Contents/Developer/usr/bin/svn*
老套路,创建链接
$sudoln-s/opt/subversion/bin/svn*/Applications/Xcode.app/Contents/Developer/usr/bin/
当然,如果你想和Xcode一样,直接把这些文件复制到Xcode下面也可以
$sudocp/opt/subversion/bin/svn*/Applications/Xcode.app/Contents/Developer/usr/bin/
5、升级旧版本检出的代码
如果你使用1.6版本的SVN客户端检出了代码,使用1.7版本的客户端的时候,可能会出一些版本不兼容的问题,解决办法是切入到代码工程所在根目录,执行以下命令进行转换
$svnupgrade
或者,把之前检出的代码全部删掉,重新检出。。。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。