SVN-WINDOWS server setup and Management

Source: Internet
Author: User
Tags svn update tortoisesvn

 

1.  Software preparation

Window-subvsersion: Http://subversion.tigris.org/servlets/ProjectDocumentList? Folderid = 91

WindowsCommon clientsTortoisesvn: Http://tortoisesvn.net/downloads

 

DownloadSubversionThe server software and client are installed by default (you can restart the operating system to update the icon ).

2. Configuration Management 2.1. Create a repository (Svnadmin)

Create an empty directory on the hard diskSVN. For example:E: \ subversion \ Repository. The following two methods are used to create the initial file structure and storage mode of the repository. Command method andTortoisesvnClient mode. All the documents below use two methods to describe the same functions. Select to use it based on the actual situation.

 

Command method (DoS):

#By defaultFsfsThis is a recommended method for data storage.BdbEasy to use

Svnadmin create E: \ subversion \ Repository

Or

Svnadmin create-FS-type bdb E: \ subversion \ Repository

 

TortoisesvnClient

 

Note that in the latest versionSvn1.4This method has compatibility issues. This client only supports1.3VersionSVNCreate a repository

 

1.UseWindow exporerOr my computer, locateE: \ subversion \ RepositoryAnd make sure that the directory is empty.

2.In the current directory, right-click and select"Tortoisesvn"->"Create repository here..."

3.In the pop-up window, select the file system mode where data exists.(Fsfs)And click OK.

4.Check whether there are system files and folders in the current directory. If yes, it is successful!

2.2. Configuration Service

Go toConfFolder. That isE: \ subversion \ repository \ conf

There are3Default configuration files:Authz,Passwd,Svnserve. conf

Svnserve. confControlSvnserveYou can configure authentication and authorization methods. A typical configuration is to setAuthzControl authorization,PasswdAccess Permissions are controlled through authentication. You can also use the anonymous method, but it is not recommended.

 

UseAuthzAndPasswdTypical Configuration:

 

Note: The configuration in the following three configuration files cannot contain spaces before each line of valid configuration. Otherwise, the configuration will fail.

 

Service configuration fileSvnserve. conf

......

###Access is not allowed anonymously.

Anon-access = none

......

### Uncomment the line below to use the default password file.

###Indicates that files are authenticated to access the repository. Passwd Provided account confirmation

Password-DB = passwd

......

### Uncomment the line below to use the default authorization file.

###Indicates that the authenticated account access permission is granted by the file Authz Definition

Authz-DB = authz

### This option specifies the authentication realm of the repository.

......

 

Authentication configuration filePasswd 

PasswdThe file actually provides account management for accessing the warehouse. The file format isIniFormat
[Users]
Harry = harryssecret

Sally = sallyssecret

User = usersecret

 

This indicates that the repository is configured with two users and one of them.Harry,His access password isHarryssecret. The access password can be in plaintext orHtpasswd.exe(ApacheInstall the tool provided by the serverApacheAfterBinThe directory containsProgramFile.

 

Authorization configuration fileAuthz

This file is responsible for the permission control of authenticated users. The configuration is slightly complicated, but it is actuallyIniConfiguration file.

Typical Configuration:

# GroupsSection provides the Configuration Group Function,However, the Group members must bePasswdThe user defined in the file is valid. You can

#Permission control. All group members have access permissions for the group.

[Groups]

#Indicates that a management group namedAdmin_group,IncludingHarryAndSally,Admin_groupDo not have spaces before

Admin_group = Harry, Sally

#The following describes the access permissions for directories in a specific repository.

#Generally, Administrators have the read and write permissions for the entire warehouse. Generally, the Administrator has the read permission for the entire warehouse.

#This is the configuration., [/]Indicates the root of the entire repository.@The corresponding permission can beR, W, RWOr empty

[/]

@ Admin_group = RW

* = R

 

After the above configuration is complete, I can start the server. The following describes how to start the server.

Note:AuthzAndPasswdFiles are often modified because of the addition of specific projects and changes in personnel.SVNMain tasks of Management

2.3. Start the service (Svnserve)

SVNThere are generally three methods for servers,Svnserve,ApacheAndSSH. Which of the following are commonly used:SvnserveAndApacheMethod. This document only usesSvnserveMethod. In generalSvnserveIs the most efficient method and is generally used in the internal development network.ApacheBecause it can be well deployed inInternetSo the public network is the most convenient to use, but the configuration is a little more complicated ~~. For the advantages and disadvantages of the three methods, refer to the reference documents later in this article.

Command method (DoS):  

Svnserve-d-r e: \ subversion \ Repository

-DParameters are started as independent services.

-RIs the physical path of the warehouse to be loaded

 

WindowsSystem Service

InSubversion1.4Later versions provide support for installation as a service

You can refer to this article for installation: 

SC create svn1.4 binpath = "\"C: \ Program Files \ subversion \ bin \ svnserve.exe "" -- service -- Root \"E: \ subversion \ repository \"" Depend = TCPIP start = auto

SC create svnservice binpath =   " D: \ subversion \ bin \ svnserve.exe -- service-r e: \ subversion \ Repository " Displayname =   " Svnservice " Depend = Tcpip start = Auto
Pause

1.Red part:SVNInstallation Directory

2.Blue part: Repository root directory

3.The format of each parameter is: Parameter Name=Value. Parameter Name and=There is no space between them,=There must be spaces,SCAbnormal features, completelyBug ..Pay attention to it.

4.This command can only be usedSvn1.4Later versions

5.Delete service:SC Delete svn1.4

2.4. Add Project (Import)

After completing the preceding installation and configuration, start the service and enter the topic. The first step is to add the project that requires version control to the repository. Before doing this job, you must accept the following,SVNRecommended project path structure. It is generally recommended to useTrunkSave the latest project trunk version,BreachesSave multiple branches,TagsGenerally, the tag version of the release or phased release is saved. As follows:

Project1/trunk

Project1/breaches

Project1/tags

Use the directory structure below to add a test projectProject1To demonstrate the process of adding a project.

Create a folder in any directoryTestAnd thenTestCreate the recommended project directory structure. As follows:

Test/project1/trunk

Test/project1/breaches

Test/project1/tags

Command method:

DoSGoTestOfSuperiorDirectory

SVN import test SVN: // localhost-M "init project1" -- username Harry -- password harryssecret

Cd c: \ Documents ents and Settings \ ike_li
SVN import D: \ test SVN: // Localhost-M "init project1" -- username admin -- password 123
Pause

NewTest "project1

New Test "project1" trunk

New Test "project1" readme.txt

New Test "project1" breaches

New Test "project1" tags

The submitted revision is1.

 

TortoisesvnClient  

1.Right-clickTestDirectory, select"Tortoisesvn"->"Import"

2.In the displayed operation interfaceURL RepositoryEnter the server addressSVN: // localhost

3.In the displayed operation interfaceImport messageText Field input belowInit project1

4.ClickOK

5.If you use it for the first time, the input account interface is displayed. Enter the corresponding user account and select Save. You do not need to enter account authentication information for the next use. 

Check whether the configuration is successfully added:

1.UseWindow exporerOr my computer, locateE: \ subversion \ RepositoryAnd make sure that the directory is empty.

2.In the current directory, right-click and select"Tortoisesvn"->"Repo-Browser"

3.In the displayed input box, enterSVNServer addressSVN: // localhost

4.InRepository BrowserIn the window, you can click the repository directory in the tree structure to check whetherProject1

5.If your users have sufficient permissions, you can right-click the tree directory on this interface to manage your repositories and projects. 

2.5. Working copy (Checkout)

After the project is added to the warehouse, it can be used in actual R & D. First, you need to create a local working copy to useCheckout. 

1.Create a working directory on any development machine. For example:D: \ workspace \ project1

2.Go to the working directory of a specific project, right-click the menu and select"SVN checkout"

3.InCheckoutWindow:

URL of repositoryIs the access address of the main warehouse of your specific project

For example:SVN: // localhost/project1/trunk

Checkout directoryIs the address of your local copy

For example:D: \ workspace \ project1

For other default options, see references for details.

4.ClickOK

2.6. Common Development Operations

The following are common operations in the development of work copies.

2.6.1. Update and Synchronization

If you submit another developer or another work copy to the latest file in the repository, you must update it to your own work copy. Use updates to make your work copies available in the server RepositoryCodeSynchronization. If both the local copy and the files in the server repository are in the same version, after the local copy modifies the file,SVNThere is no way to update it because it does not know whether to discard local modifications. By default, it will operate the merge method. However, sometimes some files cannot be automatically merged, the best method is to update the repository version. This is the synchronization operation.

The following describes how to use the client tool.TortoisesvnOther client tools and commands are similar.

1.Right-click the file to be updated or synchronized or in the folder, and selectSVN updateCommand

2.To synchronize a file or folder, you need to delete the local version before usingSVN update

2.6.2. Add and submit

...

3. References

1.SVNOfficial documentation after installation

2.SVNChinese official website:Http://www.subversion.org.cn/

3.Chinese document:Http://www.subversion.org.cn/svnbook/

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.