[Switch] SVN source code server setup-detailed tutorial

Source: Internet
Author: User
Tags svn client tortoisesvn
I. Introduction

I tried to search for a Chinese technical article on SVN source code server construction on the Internet. Unfortunately, what I found was either incomplete, either it is an article that does not help the author. tortoisesvn's help documentation is powerful, but it is not suitable for beginners because it is in English. After all, tortoisesvn is a client, server configurations are also important.

A year ago, I just graduated from college. When I first joined the company and was in development, the result was:

  • One Software Version per day
  • Bug increasing and hidden
  • Code cannot be traced forward
  • Bugs fixed a few months ago appeared again a few months later.
  • ......

Recently, the company decided to set up the svn source code server to solve the above problems. Therefore, after some time of exploration and use, I will have this article.

 

2. Prerequisites

If you meet the following requirements as a reader, this article will be of great help to you:

  • Basic software development knowledge
  • Understand the client/server model
  • Being troubled by increasingly updated software code versions

This article aims to guide readers on how to use existing software tools to manage software code versions. If you are interested in software version control and management, maintenance, and backup, you can read this article to obtain some knowledge.

 

Iii. Install SVN server software

First, you must download two software packages: visualsvn server and tortoisesvn, both of which are open-source software. As for where to download, Baidu or Google, try to use the latest version. The version I use is as follows:

 

Server: VisualSVN-Server-2.5.5.msi

Client: TortoiseSVN-1.7.5.22551-win32-svn-1.7.3.msi

 

Double-click to open the installation package:

 

Click "Next"

 

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

 

Select the first "Install visualsvn server (visual SVN server)" and "Management Console"

 

Location is your installation directory. disk C or disk D can be used. repositories is your source code repository, that is, SVN helps you manage the location of your code, here, I select to place it in the root directory of drive D, remove the check box of "use secure connection", and enter 8080 in server port (other port numbers can also be entered, but make sure that the port number is not occupied). The reason for not using secure connections here is that it will slow down the communication speed (PS: the secure connection used in the company configuration at the time, it takes more than 15 seconds to checkout each time, which is intolerable), and then click "Next ":

 

Click "Install"

 

Wait ......

 

Finish!

 

After you click "finish", the visual SVN server is started. You can see that its status is:

Visualsvn server is running

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

So far, the server software has been installed!

 

Iv. SVN server configuration items

Right-click "repositories" and select "create new repository ..."

 

Enter "testsvn" in the text box below "repository name" (for testing), select the "Create default structure (trunk, branches, tags)" option, and click OK

 

We can see that there is a testsvn library under the repositories tree, which contains three folders:

  • Branches (branch code for modifying special functions or new functions, which can be merged with the trunk)
  • Tags (TAG, set the milestone Version)
  • Trunk (trunk, storing the Code project currently being edited)

 

Start creating a user (for user group management, Please study it yourself), right-click "users", and select "create user ..."

 

In the "Create new user" dialog box, enter the account password ,:

 

You can see that there is a user in the users Folder:

 

Remember to modify the attributes of the repositories repository because the default attribute is everyone read/write, which means that anyone can read and write the contents of the repository, now we need to change it to everyone no access, and then add the user to give the user the ability to read or write, right-click "repositories" and select "properties ":

 

Select "everyone" and then select "no access ":

 

Now, add a user to testsvn, that is, zhengshuo, right-click "testsvn", and select "properties ...":

 

Click Add..., select zhengshuo under users, and click OK

 

In this way, the user zhengshuo will be added to the testsvn Project (that is, only zhengshuo has the permission to read and write testsvn ):

 

5. Install SVN client software

Double-click the following installation package:

 

Click "Next"

 

Select "I accept..." and click "Next"

 

Select the installation directory and click "Next ":

 

Start install:

 

Wait...

 

Installation complete!

 

 

6. Check out the project code from the svn Server

Create a folder testsvn in any location, such as drive D. Right-click the folder and select "SVN checkout ..."

 

Enter the URL of repository in the format of http: // your computer's IP Address: 8080/SVN/testsvn. The port number is set to 8080. Enter the IP address of your current computer, then click OK:

 

SVN prompts you to enter the account and password for verification. Because zhengshuo has been added to the server, you can log on with this account:

 

After the verification is successful, the system prompts "checkout finished !" :

 

 

7. Check the project code into the svn Server

The first check-out will obtain the directory structure in the current project testsvn, namely, branches, tags and trunk:

 

Our code should be placed in the trunk (trunk) folder. The Code is as follows:

 

Right-click the testsvn folder and choose "SVN commit ..."

 

Complete the upload reason message and click OK.

 

The message "Commit finished!" is displayed !"

 

8. Postscript

Although the content described in this article is relatively simple, it gives beginners the best starting point, so that beginners can, have a comprehensive understanding of the establishment and preliminary use of the svn source code server.

Through the establishment of the svn source code server, I also understood the importance of software code version management. The so-called "good man" is also a false thing. As a qualified software engineer, we should be good at making rational use of all the resources available around us to optimize our work environment, improve work efficiency, and write perfect software with fewer bugs for the company. (Full text)

[Switch] SVN source code server setup-detailed tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.