SVN server, client installation and configuration, import and export projects

 Subversion is an excellent version control tool, and its specific advantages and detailed introduction will not be discussed here.

First, download and build the SVN server.

Now Subversion has been migrated to the apache website, download address:

http://subversion.apache.org/packages.html

This is the download address of the binary file package, you can find the source code and the download address of the documentation in the left navigation bar.

There are a total of 5 binary file packages under the Windows operating system, as shown in the figure:

Personally, I think it is best to use the VisualSVN server server and TortoiseSVN client together.

Click on the VisualSVN connection above to download the VisualSVN server, as shown in the figure:

Then download the TortoiseSVN client, the official website download address: http://tortoisesvn.net/downloads.html

Pay attention to download the installation package that matches your computer. You can also find the language package at the bottom of the page, as shown in the figure:

After the download is complete, there should be these installation packages, as shown in the figure:

 TortoiseSVN installation package and simplified Chinese language package

VisualSVN server installation package

First install the VisualSVN server installation package, double-click the VisualSVN server installation package, as shown in the figure:

Click Next to enter the next step, as shown in the figure:

Click Agree, go to the next step, as shown in the figure:

Select one of the above options, click Next, enter the next step, as shown in the figure:

Location refers to the installation directory of VisualSVN Server, Repositorys refers to your repository directory. Server Port specifies a port, Use secure connection Goushan means to use a secure connection, Use Subversion authentication means to use Subversion's own user authentication. Click Next to enter the next Step by step, as shown in the figure:

Click Install to go to the next step, as shown in the figure:

Wait for the installation to complete, as shown in the figure:

After the installation is complete, start VisualSVN Server Manager, as shown in the figure:

Next, we install TortoiseSVN, double-click the installation package, and enter the next step. As shown in the figure:

Click Next to enter the next step, as shown in the figure:

Select Accept, and then click Next to enter the next step, as shown in the figure:

Select the installation path, and then click Next to enter the next step, as shown in the figure:

Click Install to start the installation, as shown in the figure:

Wait for the installation to complete, after the installation is complete, as shown in the figure:

Next, we install the Simplified Chinese language pack, which is very simple, just go all the way to Next, and no screenshots will be taken. After the language pack is installed, click the right mouse button on any blank space on the desktop, and you will find SVN in the right-click menu, as shown in the figure:

Select Settings and go to the next step, as shown in the figure:

Select Simplified Chinese in the language on the right, then click Apply, OK, and the localization is completed, as shown in the figure:

At this point, both the server and the client have been installed. The next article introduces the use of VisualSVN Server to create a repository and the use of TortoiseSVN.

 

The last article introduced the download, installation, and localization of VisualSVN Server and TortoiseSVN. This article introduces how to use VisualSVN Server to build a repository and the use of TortoiseSVN.

First open VisualSVN Server Manager, as shown in the figure:

You can see some information about the repository on the right side of the window, such as status, logs, user authentication, repository, etc. To create a repository, you need to right-click on Repositores in the left window, as shown in the figure:

In the pop-up right-click menu, select Create New Repository or New->Repository, and go to the next step:

Enter the repository name and check the Create default structure checkbox (recommended). Click OK, the repository is created, and three folders, trunk, branches, and tags will be created by default in the repository, as shown in the figure:

At this time, we will import the project into the repository, find your project folder, right-click on the project folder, find the SVN menu, and select Import, as shown in the figure:

Fill in the repository URL in the pop-up dialog box. This URL can be obtained from VisualSVN Server Manager. Right-click on your repository and select Copy URL to Clipboard to copy the repository URL to your clipboard. . As shown in the figure:

将复制的版本库URL粘贴上,在URL后面加上trunk子路径.然后在导入信息里面填上导入信息"导入项目到版本库".如图:

点击确定,所选中的项目就会被导入到版本库中.如图:

项目导入到版本库以后,不能随便让谁都能够读写版本库,所以需要建立用户组和用户.

在VisualSVN Server Manager窗口的左侧右键单击用户组,选择Create User或者新建->User,如图:

在弹出的对话框中填写User name和Password,然后点击OK,如图:

用相同的方式分别创建用户Develpoer1,Develpoer2,Develpoer3,Test1,Test2,Manger六个用户,分别代表3个开发人员,两个测试人员和一个项目经理,如图:

然后我们建立用户组,在VisualSVN Server Manager窗口的左侧右键单击用户组,选择Create Group或者新建->Group,如图:

在弹出窗口中填写Group name为Developers,然后点Add按钮,在弹出的窗口中选择三个Developer,加入到这个组,然后点Ok,如图:

用相同的方式创建组Managers,Testers,如图:

接下来我们给用户组设置权限,在MyRepository上单击右键,选择属性,如图:

在弹出的对话框中,选择Security选项卡,点击Add按钮,选中 Developers,Managers,Testers三个组,然后添加进来,给Developers,Managers权限设置为 Read/Write,Tester权限设置为Read Only,如图:

到此,服务端就完成了.

接下来,我们用客户端去检出代码,在桌面空白处单击右键,选择SVN检出,在弹出的对话框中填写版本库URL(具体获取方式,上面讲上传项目到版本库的时候讲过),选择检出目录,点击确定.如图:

开始检出项目,如图:

检出完成之后,我们打开工作副本文件夹,会看到所有文件和文件夹都有一个绿色的√.如图:

至此,创建版本库和使用TortoiseSVN导入项目,检出项目已经介绍完毕.

下一篇介绍TortoiseSVN的使用,以及冲突解决办法.

接下来,试试用TortoiseSVN修改文件,添加文件,删除文件,以及如何解决冲突等.

添加文件

在检出的工作副本中添加一个Readme.txt文本文件,这时候这个文本文件会显示为没有版本控制的状态,如图:

这时候,你需要告知TortoiseSVN你的操作,如图:

加入以后,你的文件会变成这个状态,如图:

这时候使用TortoiseSVN进行提交.这样别人就能看到你所做的更改了,如图.

修改文件

使用TortoiseSVN更新,修改工作副本中的Readme.txt文件,加入"hello world!",然后保存,你会发现Readme.txt文件的图标改变了,如图:

这个红色的叹号代表这个文件被修改了,这时候,提交更改,其他人即可看到你的更改.

重命名文件

使用TortoiseSVN更新,重命名工作副本中的Readme.txt文件为"Readme1.txt',然后保存,你会发现Readme.txt文件的图标改变了,如图:

更添加文件一个道理,这时候你需要告诉TortoiseSVN你的操作,如图:

加入以后,提交,这时候版本库中的Readme.txt文件将会被重命名为"Readme1.txt".

删除文件

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

强制写注释

为了以后你能更清晰的看到你所做的每一次更改的原因,你在每次提交的时候应该写上注释,而且尽量详细.如图:

但是,可能有的人因为觉得太繁琐,而不填写注释,这不利于以后的版本控制,可以将强制在提交的时候写注释,首先单击右键,选择TortoiseSVN->属性,如图:

在弹出的对话框中,点击新建->日志大小,设置提交日志的最小字符数和锁定日志的最小字符数为20,提交文本框中显示边线的字符位置设置为100,点击确定,如图:

提交,以后再次提交的时候,如果输入的注释少于20个字符,将无法提交.

冲突解决

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326491671&siteId=291194637