一、安装和配置subversion服务器windows
在windows 服务器上安装VisualSVN-Server,下载地址http://www.visualsvn.com/server/download/。采用默认安装,安装完成建立一个服务器的代码仓库hello,如图所示。xcode
而后在Users右键建立用户tony,再回到hello仓库右键- >Properties,将tony用户受权能够访问hello仓库。浏览器
若是在浏览器中经过https://192.168.1.103/svn/hello/网址访问没有问题,说明服务器端就安装和配置好了。安全
二、配置Mac OS X 的subversion客户端服务器
通常的Mac OS X都已经安装了subversion客户端,不须要再次安装了,可是因为客户端要想访问服务器,是须要进行安全认证的。 https://192.168.1.103/svn/hello/说明这是一个采用的认证SSL,你须要受权客户端就是xcode的Mac OS X的电脑。app
为此,你须要在客户端终端中输入:eclipse
$svn list https://192.168.1.103/svn/hello/svn
Error validating server certificate for 'https://192.168.1.103:443':spa
- The certificate is not issued by a trusted authority. Use the3d
fingerprint to validate the certificate manually!
- The certificate hostname does not match.
Certificate information:
- Hostname: zzr-PC
- Valid: from Tue, 27 Mar 2012 13:15:03 GMT until Fri, 25 Mar 2022 13:15:03 GMT
- Issuer: zzr-PC
- Fingerprint: fe:1b:4d:c1:27:b1:d1:cd:04:9f:11:ca:bb:93:0f:42:91:d2:0f:38
(R)eject, accept (t)emporarily or accept (p)ermanently? p
选择输入p
三、使用svn客户端功能
1.从本地导入代码到服务器(第一次初始化导入)
在终端中输入
svn import /Users/apple/Documents/eclipse_workspace/weibo svn://localhost/mycode/weibo --username=mj --password=123 -m "初始化导入"
我解释下指令的意思:将/Users/apple/Documents/eclipse_workspace/weibo中的全部内容,上传到服务器mycode仓库的weibo目录下,后面双引号中的"初始化导入"是注释
2.从服务器端下载代码到客户端本地
在终端中输入svn checkout svn://localhost/mycode --username=mj --password=123 /Users/apple/Documents/code
我解释下指令的意思:将服务器中mycode仓库的内容下载到/Users/apple/Documents/code目录中