SVN server-SVN version controller installation and configuration

Source: Internet
Author: User
Tags tortoisesvn
Document directory
  • Download the Subversion server program.
  • Download the Subversion of the Windows client TortoiseSVN.
How to quickly create a Subversion server and use it in projects is a major concern for everyone. Compared with CVS, Subversion has more options and is easier, several commands can be used to create a server environment. Animation tutorial.
This article is the fastest tutorial using Subversion. It helps you establish a set of available server environments in the shortest time, and can be applied to actual projects with just a slight adjustment.
This tutorial is divided into the following sections, not only the Quick Start, but also some advanced functions. To make it simple, the tutorial is used in windows, in order to facilitate the use of resources for limited projects, there is no big difference in UNIX environments.

Software Download

Server and client Installation

Create a version Library (Repository)

Configure users and permissions

Run an independent server

Initialize Import

Basic client operations

1. Download the Subversion server program.

Download the binary installation file from the official website, download the Binary Package, find Windows NT, 2000, XP and 2003, and select "this directory ", so we can see a lot of download content, currently you can download svn-1.4.0-setup.exe.

Download the Subversion of the Windows client TortoiseSVN.

TortoiseSVN is a tool that extends Windows Shell and can be seen as a plug-in for Windows resource manager. After installation, Windows can identify the working directory of Subversion.
The official website is TortoiseSVN. The Download method is similar to that of the svn server. On the Download page, we can select the version to Download. Currently, the installation file of the highest stable version isTortoiseSVN-1.4.0.7501-win32-svn-1.4.0.msi.

2. server and client Installation

Install the server and run svn-1.4.0-setup.exe directly. Follow the prompts to install svn-1.4.0-setup.exe. In this way, we have an environment where the server can run.

Install TortoiseSVN and run it directly.TortoiseSVN-1.4.0.7501-win32-svn-1.4.0.msiFollow the prompts to install it. However, after the installation is complete, the system will prompt whether to restart. In fact, the restart only takes effect for the special style of svn copy in windows, which has nothing to do with all the actual functions, to immediately see the effect, restart the machine. If not used to English, you can also choose to install the client language package "LanguagePack-1.4.5.10425-win32-zh_CN.exe" (also need to download), after the installation of the default or English, you need to set in the client tool.

In addition, the SVN plug-in can also be used in the compiler to replace the client tool, making development more convenient. For details, see install and use the SVN version control plug-in Eclipse.

3. Create a version Library (Repository)

To run the Subversion server, you must first create a version Library (Repository), which can be seen as a database for storing data on the server. After the Subversion server is installed, you can run it directly, for example:

svnadmin create E:\svndemo\repository

A version library is created under the directory E: \ svndemo \ repository.

We can also use TortoiseSVN to perform this step graphically:
Right-click the directory E: \ svndemo \ repository and choose TortoiseSVN> Create Repository here... ", then you can select the version library mode. Here you can use the default mode, and then create a series of directories and files.

4. Configure users and permissions

Svn permission management involves the following files:
In the passwd file --/conf directory, the user name and password used to store the svn library are separated by =, the user name is on the left, and the password (plaintext) is on the right ).
The authz --/conf directory stores the access authorization information of the svn library.
The svnserve. conf --/conf directory stores the global access control information of the svn library.

Go to the E: \ svndemo \ repository \ conf directory and modify svnserve. conf:
# [General]
# Password-db = passwd
Changed:
[General]
Password-db = passwd, then modify the passwd file in the same directory (set the user password), remove the following three lines of comments and add two users:
# [Users]
# Harry = harryssecret
# Sally = sallyssecret
Finally changed:
[Users]
Harry = harryssecret
Sally = sallyssecret
Svnadmin = admin
Zgz = zgz0809
Finally, modify the authz file in the same directory. It defines two parts:
1. Definition of group members,
2. Definition of directory authorization,
You can authorize a single user or a group defined in [groups]. You can also use the * wildcard to authorize all users,
Authorization options include: read-only access ('R'), read/write access ('rw '), or no permission to ask questions ('').
You can control permissions on any directory in the authz file. The following is an example:

[Groups]
Harry_and_sally = harry, sally
# Set a permission Group

[/]
Svnadmin = rw

[/Truck]
Zgz = rw
Harry = rw
Sally = r
* = R

[/Sanguo]
Zgz = rw
Harry = r
Sally = rw
* = R

[/Ts]
@ Harry_and_sally = rw
# Using @ as the key value means authorizing the group defined above
* = R

# [Repository:/baz/fuz]
# @ Harry_and_sally = rw
# * = R

The user svnadmin has the maximum permissions. He can perform the root directory (Note: All files (including files in subdirectories) under the Server Directory svn: // localhost/, which will be described below) and/truck,/sanguo,/ts are three subdirectories created under the root directory of the server.
Zgz and harry have read and write permissions on/truck, and sally only has read permission.
Zgz and sally have read and write permissions on/sanguo, and harry only has read permission.
Users harry and sally have read and write permissions on/ts, and zgz only has read permission. (* = R indicates that all users have the read permission. zgz naturally does. Note that @ harry_and_sally = rw indicates authorizing all users in the harry_and_sally group, which is defined in the [groups] label above)

Note: If a user has certain permissions on a directory, the user has the same permissions on its sub-directories (for example, svnadmin), so pay special attention to the authorization, try to pay only the minimum permissions required by the user.

 

5. Run the independent server

Run the following command in any directory:
Svnserve-d-r E: \ svndemo \ repository our server program has started. Do not close the command line window. Close the window will also stop svnserve. For convenience, svnserve can be used as a service. In the console window of 2000, run the following command to create a service:

SC .exe create SVNService binpath = "D: \ Subversion \ bin \ svnserve.exe -- service-r E: \ svndemo \ repository" depend = tcpip
If an error occurs, run the: SC delete "SVNService" command to delete the service.
After adding it, you can find it in the service options of the control panel, set its start type to manual, and then start it to see if there is any problem.


Note:

1. "D: \ Subversion" is the installation path of the SVN server, and "E: \ svndemo \ repository" is the path of the version library, depending on the actual situation.
2. There is no space before the equal sign and there is a space.
3. The "-- service" parameter should be used instead of "-d". the horizontal line before the parameter is not one or two.
4. If the path in binpath contains spaces, double quotation marks are also required. In this case, escape characters must be used to indicate internal quotation marks (\").
5.use cmdsvnservice.exe to run SVN as the Window service (available in versions earlier than Subversion1.4)
SVNService.exe-install-d-r E: \ svndemo \ repository

6. initialize the Import

The project root directory we want to import contains a readme.txt file in the E: \ svndemo \ wc1,directory:

Right-click TortoiseSVN and choose Import...
Enter "svn: // localhost/" in the URL of repository. if the service is installed on another machine, change localhost to the IP address "svn: // 10.8.6.87/" of the target machine /".
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.

Note that this step can be performed on another host with TortoiseSVN installed. For example, if the IP address of the host running svnserve is 10.8.6.87, the URL is entered with "svn: // 10.8.6.87/". Generally, it is not imported to the root directory of the service for ease of management, instead, it is imported to the sub-directories of the project, such as/truck,/sanguo,/ts. Svn: // localhost/truck is added to the imported URL.

7. Basic client operations

Extract the version library to a working copy:
Go to any empty directory, in this example, E: \ svndemo \ wc1, right-click-> Checkout, enter svn: // localhost/in URL of repository /, in this way, we get a copy of work.
Make changes in the work copy and submit:
Open readme.txt, modify it, and right-click Commit... to submit the modification to the version library. We can run it.

View the modifications:
Right-click readme.txt-> TortoiseSVN-> Show Log, so that we can see all the submissions to this file. Right-click on version 1 and choose Compare with working copy. We can Compare the differences between the working copy file and Version 1. The function is quite powerful, so I will not explain it in detail.

 

Related Resources
Subversion http://subversion.tigris.org/
TortoiseSVN http://tortoisesvn.net/downloads http://tortoisesvn.tigris.org/
Svn1ClickSetup Co., http://svn1clicksetup.tigris.org/
Subclipse http://subclipse.tigris.org/
Subversion Chinese site Co., http://www.subversion.org.cn/

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.