Build a Software Version Control SVN Server

Source: Internet
Author: User
What is subversion?

Subversion is a free/open-source version control system. That is to say, under subversion management, files and directories can go beyond time and space. Subversion stores files in the central version library. This version library is similar to a common file server. The difference is that it can record every file and directory modification. So we can use this to restore the data to the previous version and view the data change details. Because of this, many people regard the version control system as a magic "time machine ".

The version library of subversion can be accessed over the network, so that users can operate on different computers. To some extent, allowing users to modify and manage the same group of data in their respective spaces can promote team collaboration. Because modifications are no longer performed in a single line (that is, they must be performed in a single line), the development progress will be rapid. In addition, because all the work has been finalized, you do not have to worry about the impact on software quality due to incorrect changes-if an incorrect change occurs, you only need to cancel the change operation.

Some version control systems are also Software Configuration Management (SCM) systems. These systems are specially designed to manage the source code tree and have many features related to software development-for example, supports programming languages or provides program building tools. However, subversion is not such a system. It is a common system that can manage any types of file sets. For you, these files may be source programs, but for others, they may be a cargo list or a digital movie.

 

1. obtain resources
(1)collabnetsubversion-server-1.6.6-4.win32.exe SVN Server
Http://subversion.tigris.org/
(2) TortoiseSVN-1.6.6.17493-win32-svn-1.6.6.msi SVN Client
Http://tortoisesvn.tigris.org/
(3) LanguagePack_1.6.6.17493-win32-zh_CN.msi Chinese Simplified Language Pack (can view English words don't need)
Server and program download: http://subversion.tigris.org/getting.html#binary-packages

Windows Common Client tortoisesvn: http://tortoisesvn.net/downloads

Ankhsvn (Visual Studio plug-in): http://ankhsvn.open.collab.net/

Subclipse (Eclipse plug-in): http://subclipse.tigris.org/

Scplugin (Mac OS X client): http://scplugin.tigris.org/

 

Ii. Installation
You can directly install steps 1, 2, and 3 above. Note that you need to restart them after installation, then, extract 4 to the bin directory under the installation directory in 1. Now installation is complete

Iii. Configuration
There is nothing special to configure. You can use it after installing it. You can use the 32 client tool to right-click an empty folder and create a file library here. Select the default format and click OK. A SVN repository file is created. Go to the project or the file or folder to which you want to add version control. Right-click and choose import. In the displayed dialog box, enter the repository address, after the import is completed, a complete file version is generated.
Note: by default, the client in 2 imports the sub-folder of the current folder. If you want to import the sub-folder of the current directory, put it in a folder and then perform the import operation.
Then configure the Repository: Go to the conf file in the repository directory, find the svnserve. conf file, and
[General]
Anon-access = read
Auth-access = write
Password-DB = passwd
Realm = my first Repository
Remove the # sign in front of it, and then remove the space in front of it. Save.
The meaning here is: Anon-access refers to the anonymous access permission, which can be read, write, none. The default value is read. We recommend that you set this parameter to none.
Auth-access indicates the permission to authenticate the user. It can be read, write, or none. The default value is write.
Password-DB refers to the path of the password database, removing the previous one, storing the user name and password for authentication, username = passwd
Then modify the passwd file.
1. Remove the # above [users]. Otherwise, SVN can only Log On As an anonymous user, and the client will not display a logon window. An error will be returned unless your anon is not none.
2. Add username and password username = Password

4. Start the svn Server
1: for a single code repository
Run the svnserve-d-r folder named listen-host 192.168.100.200.
-D Indicates running in the background, and-R specifies the root directory of the server, so that you can directly access the server using SVN: // server IP address. If the server has multiple IP addresses, use listen-host to specify the IP address of the listener. We can access the svn server through SVN: // 192.168.100.200 on the svn client.
2: For Multiple code repositories
You can also use the-r option to specify the root directory of the server at startup, but you need to write the relative path of Each repository relative to the svn root directory during access. for example, we have two code repositories:/home/repoa and/home/repob. We use svnserve-d-r/home -- listen-host 192.168.100.200 to start them, when accessing the client, you can use SVN: // 192.168.100.200/repoa and SVN: // 192.168.1.200/repob to access the two projects, we can use PS aux | grep svnserv to check whether the svnserve process exists.

 

 

3: Create a system service

SC create svnserve binpath = "/" C:/program files/subversion/bin/svnserve.exe/"-- service -- root D: /service root directory "displayname =" Subversion repository "depend = TCPIP start = auto

V. Open Server ports
The default SVN port is 3690. You need to open this port on the firewall. You can also use the -- listen-port option of svnserve to specify an opened port. However, in this case, the client must use the local port, such as SVN: // 192.168.100.200: 9999 /.......

Vi. Initialization Import
Go to the project root directory we want to import, such as E:/svndemo/initproject:
1. Right click-> tortoisesvn-> Import...
2. Enter "SVN: // localhost/trunk" in the URL of repository. If you do not change localhost to IP, trunk is your specified version service directory.
3. OK
After that, the directory remains unchanged. If no error is reported, all the data has been imported to the version library we just defined.

VII.:Basic client operations
1: extract the version library to a working copy:
Go to any empty directory, such as E:/svndemo/wc1, right-click-> checkout, and enter SVN: // localhost/trunk in URL of repository, in this way, we get a copy of work.
2: Submit the client to the version Library:
Go to your working directory and right-click-> SVN commit to update your changes to the server. In order to quickly locate the problem again, we recommend that you write comments in the log when submitting the request. To prevent modifications to a resource at the same time, you can lock the file to be modified and check the lower left corner of the submission column.
3: update the version Library to the client.
Go to your working directory and right-click-> SVN update to update the changes in the version library to your working directory. In this case, some problems may occur. For example, changes in the version library may be merged or conflicted with your changes. In this case, the client will not update the changes, you need to manually select which version to use. Other situations do not need to be considered.
4. Other Common Operations
More functions are available in right-click-> tortoisesvn. If you can understand them, you can use show log to view logs. Check for modifactions to view version library changes; resolved: select the version you want after the conflict. Update to revision: select the version to be updated. add, delete, merge, and so on are literal meanings.

 

Use video Tutorials: http://www.subversion.org.cn/media/all.swf

 

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.