Install Subversion server in Windows

Source: Internet
Author: User
Tags tortoisesvn
Step 1: download and install

FirstOfficial website of subversionDownload the Windows Installation Package.
After downloading and installing it on a local machine, it is best to specify the installation directory as a pure English name directory, install it in the Chinese directory, and you will see an error that you cannot think of when you try it out.
DownloadTortoisesvnLocal installation,This is a GUI management tool that integrates SVN into Windows shell. It is recommended.

Step 2: create a repository

After installing tortoisesvn, the system prompts you to restart the machine. You can use it normally if it is not enabled. First, create the svn repository (repository). You can select the command line method or use the tortoisesvn plug-in to perform GUI operations, run the following command line:

Svnadmin create E: \ SVN \ Repository

E: \ SVN \ repository is the repository directory I specified. If you use GUI, right-click this directory and choose [totoisesvn]-> [Create repository href...] create a version library. Set the version library mode to the default one.
After repository is created, several files and folders are generated under the directory. The dav directory is the directory provided for Apache and mod_dav_svn to store internal data; the DB directory is all version-controlled data files; the hooks directory stores the directory of the hook script file; locks is used to hold the directory of the data locked by the Subversion file library, and is used to track the client that accesses the file library; the format file is a text file with only one integer in it, indicating the version number configured in the current file library;

 

Step 3: Configure

Open the/CONF/directory, open svnserve. conf, and find the following two sentences:

# [General]
# Password-DB = passwd

# At the beginning of each line, where the second row specifies the name of the authentication file, that is, the passwd file
Open the passwd file and set

# [Users]
# Harry = harryssecret
# Sally = sallyssecret

The beginning of these lines # characters are removed. This is set to a user. One row is stored in the format of "username = password". For example, you can insert a row: Admin = admin888, add a user with the username admin and password admin888 to the system.

Note: The spaces after # Must be removed together.

Step 4: run the svn Service

Execute

In Windows NT (including Windows XP, Windows 2000, and Windows 2003 Server), a tool for installing services is included, which is called "service control" and also supports SC .exe.

For example, if my subversion is installed in "D: Subversion", the version library is in "D: svnroot", and I want the corresponding subversion service name to be svnservice, the command for installing the svn service can be written as follows:

SC create svnservice
Binpath = "D: subversionbinsvnserve.exe -- service-r d: svnroot"
Displayname = "svnservice"
Depend = TCPIP

Note that the preceding command is divided into multiple lines, but it should be in one line during actual execution. In addition, the "-d" option, that is, the daemon mode, is used when svnserve is started previously. It cannot be used here, and the service cannot be started. Similarly, the "-I" and "-T" options cannot be used.

After the command is executed in the command line window, the service has not been started. You can continue to run "Net start svnservice" to start the service and then stop the service using "net stop svnservice.

There are two other points to be handled with caution. First, if the path contains spaces, you must use "" to process "". If svnserve.exe is in "C: Program filessubversion", the command should be written as "binpath =" "C: program filessubversionbinsvnserve.exe "" ("" In the content), the entire command is as follows, the red part is changed:

SC create svnservice
Binpath = "" D: Program filessubversionbinsvnserve.exe "-- service-r d: svnroot"
Displayname = "svnservice"
Depend = TCPIP

Second,SC also requires the option format. For example, "depend = TCPIP" cannot be written as "depend = TCPIP" or "depend = TCPIP", that is"=" Must be followed by spaces.

Step 5: Create a project version tree

After confirming that the svn Service (command line or Windows Service) is running, right-click the directory where you want to import the repository and choose [tortoisesvn]-> [import...], in the pop-up window, enter "SVN: // localhost/myproject" and click "OK" to import data. If no error is reported, all data is added to the svn repository directory tree. You can also use the command line to complete these operations. You need to create a system variable named "svn_editor" in the system variable. The variable value is the path of a local text editor execution file, it usually refers to "C: \ WINDOWS \ notepad.exe" on the Windows notepad, and then a new cmd window is opened to execute

SVN mkdir SVN: // localhost/myproject

Close the log file window opened in notepad and press "c" to continue and generate the project tree. Generally, we should create three directories after creating the root path of the file: branches, tags, and trunk. These three directories are required by subversion. For check out, commit, update, and other operations, you can run the command line through SVN, or use the Windows menu of tortoisesvn, which is very simple.

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.