Windows-SVN configuration

1. SVN server set up

Download the corresponding version of the good version, install VisualSVN server installation package, double-click the VisualSVN server installation package, as:
Here Insert Picture Description
Point Next, enter the next step, as shown:
Here Insert Picture Description
point agreed, the next step into the map, as shown:
Here Insert Picture Description
choose one of the options above, point Next, enter the next step, as shown:
Here Insert Picture Description
select "StandardEdition" version, click on "the Next"
Here Insert Picture Description
the Location refers to the installation directory of VisualSVN Server, Repositorys is to specify your repository directory .Server port on a designated port, Use secure connection hook representation use secure connection, use Subversion authentication indication Subversion own user authentication click Next, enter the next step, as shown:
Here Insert Picture Description
point install, the next step, as shown:
Here Insert Picture Description
wait for the installation to complete, as shown:
Here Insert Picture Description
after installation is complete, start the VisualSVN Server Manager Figure:
Here Insert Picture Description

2. SVN client built

2.1 接下来我们安装TortoiseSVN,双击安装包,进入下一步.如图:
Here Insert Picture Description
Here Insert Picture Description
点击Next,进入下一步,如图:
Here Insert Picture Description
选择接受,然后点击Next,进入下一步,如图:
Here Insert Picture Description
选择安装路径,然后点击Next,进入下一步,如图:
Here Insert Picture Description
点击Install,开始安装,如图:
Here Insert Picture Description
等待安装完成,安装完成后如图:
Here Insert Picture Description
接下来我们安装简体中文语言包,这个非常简单,一路Next就行,就不截图了.语言包安装完成以后在桌面任意空白地方单击鼠标右键,会在右键菜单里找到SVN,如图:
Here Insert Picture Description
选择设置,进入下一步,如图:
Here Insert Picture Description在右边的语言里面选择简体中文,然后点击应用,确定,汉化即完成,如图:
Here Insert Picture Description
到这里,服务端和客户端都已经安装完毕,下一篇介绍用VisualSVN Server创建版本库,以及TortoiseSVN的使用.

3. SVN服务器的使用

首先打开VisualSVN Server Manager,如图:
Here Insert Picture Description
可以在窗口的右边看到版本库的一些信息,比如状态,日志,用户认证,版本库等.要建立版本库,需要右键单击左边窗口的Repositores,如图:
Here Insert Picture Description
在弹出的右键菜单中选择Create New Repository或者新建->Repository,进入下一步:
Here Insert Picture Description
在”Repository Name”中输入名称,然后点击“下一步”。
Here Insert Picture Description
选择第二个选项“Single_project repository”,点击“下一步”。
Here Insert Picture Description
点击“Create”
Here Insert Picture Description
点击”Finish”,版本库就创建好了,版本库中会默认建立trunk,branches,tags三个文件夹,如图:
Here Insert Picture Description
这时候我们将项目导入到版本库中,找到你的项目文件夹,在项目文件夹上点击鼠标右键,找到SVN菜单,选择导入,如图:
Here Insert Picture Description
在弹出的对话框中填上版本库URL,这个URL可以从VisualSVN Server Manager中获取,在你的版本库上单击右键,选择Copy URL to Clipboard,这样就把版本库URL复制到你的剪贴版了.如图:
Here Insert Picture Description
将复制的版本库URL粘贴上,在URL后面加上trunk子路径.然后在导入信息里面填上导入信息"导入项目到版本库".如图:
Here Insert Picture Description
点击确定,所选中的项目就会被导入到版本库中.如图:
Here Insert Picture Description
项目导入到版本库以后,不能随便让谁都能够读写版本库,所以需要建立用户组和用户.
在VisualSVN Server Manager窗口的左侧右键单击用户组,选择Create User或者新建->User,如图:
Here Insert Picture Description
在弹出的对话框中填写User name和Password,然后点击OK,如图:
Here Insert Picture Description
用相同的方式分别创建用户Develpoer1,Develpoer2,Develpoer3,Test1,Test2,Manger六个用户,分别代表3个开发人员,两个测试人员和一个项目经理,如图:
Here Insert Picture Description
然后我们建立用户组,在VisualSVN Server Manager窗口的左侧右键单击用户组,选择Create Group或者新建->Group,如图:
Here Insert Picture Description
在弹出窗口中填写Group name为Developers,然后点Add按钮,在弹出的窗口中选择三个Developer,加入到这个组,然后点Ok,如图:
Here Insert Picture Description
用相同的方式创建组Managers,Testers,如图:
Here Insert Picture Description
接下来我们给用户组设置权限,在project1上单击右键,选择属性,如图:
Here Insert Picture Description
在弹出的对话框中,选择Security选项卡,点击Add按钮,选中Developers,Managers,Testers三个组,然后添加进来,给Developers,Managers权限设置为Read/Write,Tester权限设置为Read Only,如图:
Here Insert Picture Description
到此,服务端就完成了

接下来,我们用客户端去检出代码,在桌面空白处单击右键,选择SVN检出,在弹出的对话框中填写版本库URL(具体获取方式,上面讲上传项目到版本库的时候讲过),选择检出目录,点击确定.如图:
Here Insert Picture Description
开始检出项目,如图:
Here Insert Picture Description
检出完成之后,我们打开工作副本文件夹,会看到所有文件和文件夹都有一个绿色的√.如图:
Here Insert Picture Description
至此,创建版本库和使用TortoiseSVN导入项目,检出项目已经介绍完毕.

4、SVN服务器搭建和使用

接下来,试试用TortoiseSVN修改文件,添加文件,删除文件,以及如何解决冲突等
1、添加文件
在检出的工作副本中添加一个Readme.txt文本文件,这时候这个文本文件会显示为没有版本控制的状态,如图:
Here Insert Picture Description
这时候,你需要告知TortoiseSVN你的操作,如图:
Here Insert Picture Description
加入以后,你的文件会变成这个状态,如图:
Here Insert Picture Description
这时候使用TortoiseSVN进行提交.这样别人就能看到你所做的更改了,如图.
Here Insert Picture Description
2、修改文件
使用TortoiseSVN更新,修改工作副本中的Readme.txt文件,加入"hello world!",然后保存,你会发现Readme.txt文件的图标改变了,如图:
Here Insert Picture Description
这个红色的叹号代表这个文件被修改了,这时候,提交更改,其他人即可看到你的更改
重命名文件
使用TortoiseSVN更新,重命名工作副本中的Readme.txt文件为"Readme1.txt’,然后保存,你会发现Readme.txt文件的图标改变了,如图:
Here Insert Picture Description
跟添加文件一个道理,这时候你需要告诉TortoiseSVN你的操作,如图:
Here Insert Picture Description
加入以后,提交,这时候版本库中的Readme.txt文件将会被重命名为"Readme1.txt".

3、删除文件
使用TortoiseSVN更新,使用TortoiseSVN删除工作副本中的Readme.txt文件,然后提交,版本库中的相应文件即被删除掉了,如图:
Here Insert Picture Description

强制写注释
为了以后你能更清晰的看到你所做的每一次更改的原因,你在每次提交的时候应该写上注释,而且尽量详细.如图:
Here Insert Picture Description
但是,可能有的人因为觉得太繁琐,而不填写注释,这不利于以后的版本控制,可以将强制在提交的时候写注释,首先单击右键,选择TortoiseSVN->属性,如图:
Here Insert Picture Description
在弹出的对话框中,点击新建->日志大小,设置提交日志的最小字符数和锁定日志的最小字符数为20,提交文本框中显示边线的字符位置设置为100,点击确定,如图:
Here Insert Picture Description
提交,以后再次提交的时候,如果输入的注释少于20个字符,将无法提交

4、冲突解决
冲突问题是最常见的问题,它是这样产生的,A用户check out了一个工作副本A,接着B用户又check out了一个工作副本B.然后A用户对副本A中的文件C做了修改(可以是内容修改,文件删除,重命名,以及位置移动),并且提交.这时候B用户也对文件C的相同部分做了修改,这时候如果B用户进行提交,会先被告知版本过时,要求更新,然后更新的时候会提示冲突了,这时候可以用冲突编辑器进行手动选择.

5. TortoiseSVN客户端重新设置用户名和密码

5.1 the first time using TortoiseSVN CheckOut from the server, will be asked to enter a user name and password, and then enter the box below option is to save the authentication information, if this option is selected, then the future will not have to enter it again each time a user name password.
5.2 If, however, later revised the user name and password on the server side, it will be wrong again when checking out, and this client is mentally retarded, does not automatically jump out of a user name and password input box after the update makes a mistake, I'm looking for a long time I did not find the username and password to change this place.
5.3 Finally, find two solutions:
5.4 a way: in TortoiseSVN's settings dialog box, select "Saved Data" in the "authentication data" that line click on the "Clear" button to clear the saved authentication data, and then detected when it will re-enter the username and password out of the box.
Here Insert Picture Description

Published 44 original articles · won praise 1 · views 1410

Guess you like

Origin blog.csdn.net/cc_park/article/details/104196130