Detailed tutorial analysis based on SVN source server setup of

  • 2020-04-02 01:11:09
  • OfStack

One, the introduction
I once tried to search the web for a technical article in Chinese on SVN source server setup, but I found either incomplete articles or articles of little help to me. TortoiseSvn's help document was powerful, but it was not suitable for beginners because it was in English. After all, TortoiseSvn is a client and the configuration on the server side is important.
A year ago, the author just graduated, the first company, in the development, due to the lack of software code version management, resulting in the results
The & # 8226; One version of software a day
The & # 8226; Bugs are growing and hiding
The & # 8226; The code cannot go back
The & # 8226; A Bug that was fixed a few months ago reappeared a few months later
Because the company recently decided to set up SVN source server, to solve the above problems, so the author after a period of exploration and use, there is this article.

Study the prerequisites of this article
This article will be of great help to you as a reader if you:
The & # 8226; Basic knowledge of software development
The & # 8226; Understand the Client/Server model
The & # 8226; Is plagued by increasingly updated versions of software code
The purpose of this article is to guide readers on how to use existing software tools for software code version management. If you are interested in software version control and management, maintenance and backup, you can read this article for some knowledge.

3. Install SVN server software
First, you have to download two software packages: VisualSVN Server and TortoiseSVN, both open source software. As for where to download, baidu or Google, just try to use the latest version.

Server: visual svn-server-2.5.5.5.msi
Client: tortoisesvn-1.7.5.22551 -win32-svn-1.7.3.msi
 
Double-click the following icon to open the installation package:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425631.png ">

Click "Next"

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425632.png ">

Check the "I accept..." , and then click "Next"

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425633.png ">

Select the first "install VisualSVN Server" and "Management Console"

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425634.png ">

Location is your installation directory, C or D dish can be, the source code Repositories is your warehouse, namely SVN you help you to manage the Location of the code is placed, here I choose to place in D packing directory, will "Use secure connection" check box to box, and then fill in the Server Port 8080 (can also fill other Port, but make sure that the Port number is not being used), here is the cause of not using a secure connection, it can lead to communication speed slow (PS: Secure connection, which was then used in the corporate configuration, took more than 15 seconds to Checkout each time, which was intolerable), and then clicked "Next" :

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425635.png ">

Click the "Install"

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425636.png ">

Waiting......

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425637.png ">

Finish!

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425638.png ">

When you click "Finish", the VisualSVN Server is started, and as you can see, its Status is:

VisualSVN Server is running

Server URL is http://motor-109133.hanslaser.com:8080/svn/

At this point, the server software is installed!

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425639.png "width = 712 height = 567 >

Iv. SVN server configuration project

Right-click on "Repositories" and select "Create New Repository..."

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425640.png "width = 699 height = 535 >

Fill in "TestSvn" (for testing purposes) in the text box below "Repository Name", check the "Create default structure(trunk,branches,tags)" option, and click OK

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425641.png "width = 683 height = 555 >

You can see that under the Repositories tree there is a TestSvn library with three folders in it:

Branches (branch code to modify special or new functionality, which can be merged with the trunk)

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425642.png "width = 697 height = 576 >

To start creating new Users (please study the User group management), right-click "Users" and select "Create User...".

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425643.png "width = 703 height = 574 >

Fill in the account password in the "Create New User" dialog box, as shown in the figure:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425644.png "width = 698 height = 575 >

You can see that there is a user under the Users folder:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425645.png "width = 685 height = 538 >

Remember to change the Properties of Repositories, because the default property is Everyone Read/Write, which means anyone can Read or Write to the contents of the repository. Now we'll change it to Everyone No Access, and then we'll add our own users, giving them the ability to Read or Write. Right-click on "Repositories" and select "Properties" :

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425646.png "width = 684 height = 578 >

Select "Everyone" and then check "No Access" :

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425647.png "width = 688 height = 581 >

Now start adding a user to TestSvn, the account you just added: zhengshuo, right-click "TestSvn" and select "Properties..." :

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425648.png "width = 684 height = 569 >

Click the "Add..." , select zhengshuo under Users, and click OK

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425649.png "width = 702 height = 517 >

Thus, user zhengshuo is added to the TestSvn project (i.e., currently only zhengshuo has access to TestSvn) :

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425650.png "width = 694 height = 595 >

V. install SVN client software

Double-click the following installation package:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425651.png ">

Click "Next"

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425652.png ">

Select "I accept..." , click "Next"

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425653.png ">

Select the installation directory and click "Next" :

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425654.png ">

Begin to Install:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425655.png ">

Wait...

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425656.png ">

Installed!

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425657.png ">

Vi. Check out the project code from SVN server

Create a folder TestSvn in any location, such as disk D, right-click the folder, and select "SVN Checkout..."

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425658.png ">

Fill in the "URL of Repository" in the form of http:// your computer's IP address :8080/ SVN /TestSvn, port number :8080 as previously set, IP address: fill in the IP address of your current computer, and then click OK:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425659.png ">  

SVN will prompt you to enter the account password for verification. Since the account of zhengshuo has been added in the server, you can log in with this account:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425660.png ">

When the validation is successful, the prompt is "Checkout Finished!" :

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425661.png ">

7. Check in the project code to the SVN server

The first check out gets the directory structure in the current project TestSvn, namely branches, tags, and trunk:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425662.png ">

Our code is in the trunk folder, and it looks like this:

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425663.png "width = 522 height = 246 >

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425664.png ">

Right-click the TestSvn folder and select "SVN Commit..."

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425665.png ">

Fill in the upload reason Message and click OK

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425666.png ">

Prompt "Commit Finished!"

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201306/2013060410425667.png "width = 626 height = 281 >

Eight, afterword.
Although the content of this article is relatively simple, but, it gives beginners an optimal entry point, let beginners can in the shortest time, the establishment of SVN source server and the initial use of a comprehensive understanding.

Through to the SVN source server set up, also let me understand the importance of software code version management, is the so-called gentleman good false to content also, we, as a qualified software engineers, be good at reasonable use side all can take advantage of the resources, to optimize our work environment, improve the work efficiency, for the company to write a Bug is less perfect software.


Related articles: