Subversion是优秀的版本控制工具,其具体的的优点和详细介绍,这里就不再多说.
首先来下载和搭建SVN服务器.
现在Subversion已经迁移到apache网站上了,下载地址:
http://subversion.apache.org/packages.html
这是二进制文件包的下载地址,你可在左侧的导航栏找到源代码,文档的下载地址.
windows操作系统下面的二进制文件包一共有5种,如图:
id="iframe_0.37381739169359207" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152376.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.37381739169359207',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 573px; height: 219px;">
个人认为最好用VisualSVN server 服务端和 TortoiseSVN客户端搭配使用.
点开上面的VisualSVN连接,下载VisualSVN server,如图:
id="iframe_0.058097066823393106" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152477.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.058097066823393106',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 973px; height: 627px;">
然后下载TortoiseSVN客户端,官网下载地址:http://tortoisesvn.net/downloads.html
id="iframe_0.46933119371533394" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152479.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.46933119371533394',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 898px; height: 638px;">
注意下载跟你电脑匹配的安装包,在页面的下面你还可以找到语言包,如图:
id="iframe_0.032892001094296575" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152482.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.032892001094296575',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 576px; height: 236px;">
下载完成后,应该有这些安装包,如图:
id="iframe_0.004042542306706309" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152484.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.004042542306706309',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 385px; height: 37px;">
TortoiseSVN安装包和简体中文语言包
id="iframe_0.6396697573363781" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152487.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6396697573363781',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 276px; height: 24px;">
VisualSVN server安装包
先安装VisualSVN server的安装包,双击VisualSVN server安装包,如图:
id="iframe_0.13754628808237612" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152488.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.13754628808237612',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 498px; height: 383px;">
点Next,进入下一步,如图:
id="iframe_0.07131664780899882" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152491.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.07131664780899882',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 497px; height: 383px;">
点同意,进图下一步,如图:
id="iframe_0.6547672876622528" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152492.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6547672876622528',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 497px; height: 382px;">
选择上面一个选项,点Next,进入下一步,如图:
id="iframe_0.24574942677281797" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152493.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.24574942677281797',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 496px; height: 383px;">
Location是指VisualSVN Server的安装目录,Repositorys是指定你的版本库目录.Server Port指定一个端口,Use secure connection勾山表示使用安全连接,Use Subversion authentication 表示使用Subversion自己的用户认证.点击Next,进入下一步,如图:
id="iframe_0.9227755826432258" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152494.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9227755826432258',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 500px; height: 383px;">
点Install,进入下一步,如图:
id="iframe_0.7056918167509139" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/2014121709152597.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.7056918167509139',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 497px; height: 379px;">
等待安装完成,如图:
id="iframe_0.817102377070114" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091525106.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.817102377070114',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 496px; height: 383px;">
安装完成后,启动VisualSVN Server Manager,如图:
id="iframe_0.37904443754814565" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091526109.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.37904443754814565',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 817px; height: 616px;">
接下来我们安装TortoiseSVN,双击安装包,进入下一步.如图:
id="iframe_0.38052666070871055" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091526111.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.38052666070871055',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 501px; height: 384px;">
点击Next,进入下一步,如图:
id="iframe_0.9462695166002959" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527113.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9462695166002959',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 497px; height: 383px;">
选择接受,然后点击Next,进入下一步,如图:
id="iframe_0.14624476339668036" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527115.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.14624476339668036',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 500px; height: 383px;">
选择安装路径,然后点击Next,进入下一步,如图:
id="iframe_0.9717608806677163" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527117.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9717608806677163',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 498px; height: 383px;">
点击Install,开始安装,如图:
id="iframe_0.8005677086766809" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527119.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.8005677086766809',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 494px; height: 381px;">
等待安装完成,安装完成后如图:
id="iframe_0.5016507108230144" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527121.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5016507108230144',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 497px; height: 383px;">
接下来我们安装简体中文语言包,这个非常简单,一路Next就行,就不截图了.语言包安装完成以后在桌面任意空白地方单击鼠标右键,会在右键菜单里找到SVN,如图:
id="iframe_0.932782270712778" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527122.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.932782270712778',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 350px; height: 333px;">
选择设置,进入下一步,如图:
id="iframe_0.9770625822711736" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527123.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9770625822711736',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 700px; height: 428px;">
在右边的语言里面选择简体中文,然后点击应用,确定,汉化即完成,如图:
id="iframe_0.482207955326885" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527124.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.482207955326885',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 349px; height: 332px;">
到这里,服务端和客户端都已经安装完毕,下一篇介绍用VisualSVN Server创建版本库,以及TortoiseSVN的使用.
SVN服务器搭建和使用(二)
上一篇介绍了VisualSVN Server和TortoiseSVN的下载,安装,汉化.这篇介绍一下如何使用VisualSVN Server建立版本库,以及TortoiseSVN的使用.
首先打开VisualSVN Server Manager,如图:
id="iframe_0.20847732690162957" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527128.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.20847732690162957',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 820px; height: 617px;">
可以在窗口的右边看到版本库的一些信息,比如状态,日志,用户认证,版本库等.要建立版本库,需要右键单击左边窗口的Repositores,如图:
id="iframe_0.7670017348136753" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091527130.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.7670017348136753',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 304px; height: 161px;">
在弹出的右键菜单中选择Create New Repository或者新建->Repository,进入下一步:
id="iframe_0.03653060388751328" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528131.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.03653060388751328',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 394px; height: 210px;">
输入版本库名称,勾上Create default structure复选框(推荐这么做).点击OK,版本库就创建好了,版本库中会默认建立trunk,branches,tags三个文件夹,如图:
id="iframe_0.8386421774048358" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528132.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.8386421774048358',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 442px; height: 113px;">
这时候我们将项目导入到版本库中,找到你的项目文件夹,在项目文件夹上点击鼠标右键,找到SVN菜单,选择导入,如图:
id="iframe_0.6586989490315318" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528133.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6586989490315318',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 444px; height: 405px;">
在弹出的对话框中填上版本库URL,这个URL可以从VisualSVN Server Manager中获取,在你的版本库上单击右键,选择Copy URL to Clipboard,这样就把版本库URL复制到你的剪贴版了.如图:
id="iframe_0.4367797411978245" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528134.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.4367797411978245',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 248px; height: 190px;">
将复制的版本库URL粘贴上,在URL后面加上trunk子路径.然后在导入信息里面填上导入信息"导入项目到版本库".如图:
id="iframe_0.10066187055781484" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528135.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.10066187055781484',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 455px; height: 333px;">
点击确定,所选中的项目就会被导入到版本库中.如图:
id="iframe_0.7850813488475978" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528136.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.7850813488475978',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 662px; height: 294px;">
项目导入到版本库以后,不能随便让谁都能够读写版本库,所以需要建立用户组和用户.
在VisualSVN Server Manager窗口的左侧右键单击用户组,选择Create User或者新建->User,如图:
id="iframe_0.019287261413410306" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528137.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.019287261413410306',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 262px; height: 119px;">
在弹出的对话框中填写User name和Password,然后点击OK,如图:
id="iframe_0.9625764498487115" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528138.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9625764498487115',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 359px; height: 203px;">
用相同的方式分别创建用户Develpoer1,Develpoer2,Develpoer3,Test1,Test2,Manger六个用户,分别代表3个开发人员,两个测试人员和一个项目经理,如图:
id="iframe_0.1458332585170865" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528139.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.1458332585170865',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 138px; height: 109px;">
然后我们建立用户组,在VisualSVN Server Manager窗口的左侧右键单击用户组,选择Create Group或者新建->Group,如图:
id="iframe_0.5481257105711848" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528140.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5481257105711848',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 274px; height: 116px;">
在弹出窗口中填写Group name为Developers,然后点Add按钮,在弹出的窗口中选择三个Developer,加入到这个组,然后点Ok,如图:
id="iframe_0.48076228937134147" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528141.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.48076228937134147',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 359px; height: 365px;">
用相同的方式创建组Managers,Testers,如图:
id="iframe_0.22956614452414215" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528142.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.22956614452414215',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 327px; height: 81px;">
接下来我们给用户组设置权限,在MyRepository上单击右键,选择属性,如图:
id="iframe_0.9768713440280408" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091528143.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9768713440280408',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 263px; height: 236px;">
在弹出的对话框中,选择Security选项卡,点击Add按钮,选中Developers,Managers,Testers三个组,然后添加进来,给Developers,Managers权限设置为Read/Write,Tester权限设置为Read Only,如图:
id="iframe_0.9873490515165031" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529144.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9873490515165031',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 372px; height: 469px;">
到此,服务端就完成了.
接下来,我们用客户端去检出代码,在桌面空白处单击右键,选择SVN检出,在弹出的对话框中填写版本库URL(具体获取方式,上面讲上传项目到版本库的时候讲过),选择检出目录,点击确定.如图:
id="iframe_0.9224898044485599" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529146.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9224898044485599',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 458px; height: 375px;">
开始检出项目,如图:
id="iframe_0.6825251150876284" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529147.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6825251150876284',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 656px; height: 293px;">
检出完成之后,我们打开工作副本文件夹,会看到所有文件和文件夹都有一个绿色的√.如图:
id="iframe_0.9158643884584308" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529148.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9158643884584308',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 391px; height: 126px;">
至此,创建版本库和使用TortoiseSVN导入项目,检出项目已经介绍完毕.
下一篇介绍TortoiseSVN的使用,以及冲突解决办法.
SVN服务器搭建和使用(三)
接下来,试试用TortoiseSVN修改文件,添加文件,删除文件,以及如何解决冲突等.
添加文件
在检出的工作副本中添加一个Readme.txt文本文件,这时候这个文本文件会显示为没有版本控制的状态,如图:
id="iframe_0.1983275436796248" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529149.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.1983275436796248',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 393px; height: 119px;">
这时候,你需要告知TortoiseSVN你的操作,如图:
id="iframe_0.9341893726959825" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529150.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9341893726959825',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 445px; height: 312px;">
加入以后,你的文件会变成这个状态,如图:
id="iframe_0.4793889094144106" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529152.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.4793889094144106',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 392px; height: 109px;">
这时候使用TortoiseSVN进行提交.这样别人就能看到你所做的更改了,如图.
id="iframe_0.5753453699871898" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529153.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.5753453699871898',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 390px; height: 223px;">
修改文件
使用TortoiseSVN更新,修改工作副本中的Readme.txt文件,加入"hello world!",然后保存,你会发现Readme.txt文件的图标改变了,如图:
id="iframe_0.3794169342145324" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529155.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.3794169342145324',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 395px; height: 109px;">
这个红色的叹号代表这个文件被修改了,这时候,提交更改,其他人即可看到你的更改.
重命名文件
使用TortoiseSVN更新,重命名工作副本中的Readme.txt文件为"Readme1.txt',然后保存,你会发现Readme.txt文件的图标改变了,如图:
id="iframe_0.9167996463365853" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529156.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9167996463365853',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 392px; height: 106px;">
更添加文件一个道理,这时候你需要告诉TortoiseSVN你的操作,如图:
id="iframe_0.8970101845916361" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/statics/images/s_nopic.gif?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.8970101845916361',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 47px; height: 11px;">
加入以后,提交,这时候版本库中的Readme.txt文件将会被重命名为"Readme1.txt".
删除文件
使用TortoiseSVN更新,使用TortoiseSVN删除工作副本中的Readme.txt文件,然后提交,版本库中的相应文件即被删除掉了,如图:
id="iframe_0.2194503142964095" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091529161.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.2194503142964095',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 541px; height: 408px;">
强制写注释
为了以后你能更清晰的看到你所做的每一次更改的原因,你在每次提交的时候应该写上注释,而且尽量详细.如图:
id="iframe_0.6894989842548966" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091530162.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6894989842548966',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 607px; height: 509px;">
但是,可能有的人因为觉得太繁琐,而不填写注释,这不利于以后的版本控制,可以将强制在提交的时候写注释,首先单击右键,选择TortoiseSVN->属性,如图:
id="iframe_0.7255603896919638" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091530163.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.7255603896919638',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 389px; height: 101px;">
在弹出的对话框中,点击新建->日志大小,设置提交日志的最小字符数和锁定日志的最小字符数为20,提交文本框中显示边线的字符位置设置为100,点击确定,如图:
id="iframe_0.9539148551411927" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091530164.png?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.9539148551411927',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 650px; height: 341px;">
提交,以后再次提交的时候,如果输入的注释少于20个字符,将无法提交.
冲突解决
冲突问题是最常见的问题,它是这样产生的,A用户check out了一个工作副本A,接着B用户又check out了一个工作副本B.然后A用户对副本A中的文件C做了修改(可以是内容修改,文件删除,重命名,以及位置移动),并且提交.这时候B用户也对文件C的相同部分做了修改,这时候如果B用户进行提交,会先被告知版本过时,要求更新,然后更新的时候会提示冲突了,这时候可以用冲突编辑器进行手动选择.
TortoiseSVN客户端重新设置用户名和密码
在第一次使用TortoiseSVN从服务器CheckOut的时候,会要求输入用户名和密码,这时输入框下面有个选项是保存认证信息,如果选了这个选项,那么以后就不用每次都输入一遍用户名密码了。
不过,如果后来在服务器端修改了用户名密码,则再次检出时就会出错,而且这个客户端很弱智,出错之后不会自动跳出用户名密码输入框让人更新,我找了半天也没找到修改这个用户名密码的地方。
最终,找到两种解决办法:
办法一:在TortoiseSVN的设置对话框中,选择“已保存数据”,在“认证数据”那一行点击“清除”按钮,清楚保存的认证数据,再检出的时候就会重新跳出用户名密码输入框。
id="iframe_0.07427250826731324" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://www.2cto.com/uploadfile/Collfiles/20141217/20141217091530168.jpg?_=5250198%22%20style=%22border:none;max-width:1251px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.07427250826731324',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="border-style: none; border-width: initial; width: 703px; height: 439px;">
如果方法一不起作用,则可以采用方法二:
Tortoise的用户名密码等认证信息都是缓存在客户端文件系统的这个目录:
C:/Documents and Settings/Administrator/Application Data/Subversion/auth
删除auth下面的所有文件夹,重新连接远程服务器进行检出,对话框就会出现!