Subversion Quick Start Tutorial

How to quickly build a Subversion server and use it in a project is what everyone is most concerned about. Compared with CVS, Subversion has more options and is easier. You can build a server environment with a few commands. To use it, there is an animation tutorial here .
This article is the fastest tutorial on using Subversion, helping you set up a usable server environment in the shortest time, and can be applied to actual projects with only a few adjustments.
This tutorial is divided into the following parts. For the sake of simplicity, the tutorial is used under Windows to facilitate the use of projects with limited resources. In the UNIX environment, only the installation method is different, and the command execution is not much different.
  • software download
  • Server and client installation
  • Create a repository (Repository)
  • Configure users and permissions
  • run a standalone server
  • init import
  • Basic Client Operations

1. Software download

Download the Subversion server program.

Go to the official website to download the binary installation file, go to the binary package download section , find the Windows NT, 2000, XP and 2003 section, then select Apache 2.0 or Apache 2.2 , so we can see many downloads, currently you can download Setup- Subversion-1.5.3.msi .

Download TortoiseSVN, the Windows client for Subversion.

TortoiseSVN is a set of tools for extending the Windows Shell. It can be regarded as a plug-in for Windows Explorer. After installation, Windows can recognize the working directory of Subversion.
The official website is TortoiseSVN . The download method is similar to the previous svn server. On the Download page, we can choose the version to download. The installation file of the current highest stable version is TortoiseSVN-1.5.5.14361-win32-svn-1.5.4.msi .

2. Server and client installation

Server installation, run Setup-Subversion-1.5.3.msi directly , and install it according to the prompts, so that we have a set of environment where the server can run.

To install TortoiseSVN, run TortoiseSVN-1.5.5.14361-win32-svn-1.5.4.msi directly and follow the prompts to install it, but after the final completion, you will be prompted whether to restart. In fact, restarting only makes the special style of the svn working copy in windows take effect. , has nothing to do with all the actual functions, here in order to see the good effect immediately, or restart the machine.
 

3. Create a repository (Repository)

To run the Subversion server, you must first establish a repository (Repository), which can be regarded as a database for storing data on the server. After installing the Subversion server, you can run it directly, such as:

svnadmin create E:\svndemo\repository

A repository will be created in the directory E:\svndemo\repository.

We can also use TortoiseSVN to complete this step graphically:
"Right click->TortoiseSVN->Create Repository here..." in the directory E:\svndemo\repository, then you can select the repository mode, use the default here, then A series of directories and files are created.


4. Configure users and permissions

Go to the E:\svndemo\repository\conf directory, modify svnserve.conf:
# [general]
# password-db = passwd Change
to:
[general]
password-db = passwd

Then modify the passwd file in the same directory and remove the comments on the following three lines:
# [users]
# harry = harryssecret
# sally = sallyssecret
finally becomes:
[users]
harry = harryssecret
sally = sallyssecret

 In the passwd file, the character before "=" is the username, and the character after it is the password. Also note that the comment "#" in front of "[users]" must be deleted.

5. Run a standalone server

Run in any directory:
svnserve -d -r E:\svndemo\repository Our server program has been started. Be careful not to close the command line window, closing the window will also stop svnserve.

6. Initialize the import

Go to the root directory of the project we want to import, in this case E:\svndemo\initproject, there is a readme.txt file in the directory:


Right click->TortoiseSVN->Import...
Enter "svn://localhost/trunk" in URL of repository
and enter your log information in Import Message

After the completion, there is no change in the directory. If there is no error, the data has been imported into the repository we just defined.

It should be noted that this step can be performed entirely on another host where TortoiseSVN is installed. For example, the IP of the host running svnserve is 133.96.121.22, and the content entered in the URL part is "svn://133.96.121.22/trunk".

7. Basic client operation

Extract the repository to a working copy: 

Go to any empty directory, in this case E:\svndemo\wc1, run right click->Checkout, enter svn://localhost/trunk in URL of repository, so we get a working copy. 

 

Make changes in the working copy and commit: 

Open readme.txt, make changes, then right click -> Commit..., so we submit the changes to the repository, and we can run.

 

Check out the changes made: 

Right-click on readme.txt->TortoiseSVN->Show Log, so we can see all our commits to this file. Right-click on version 1 -> Compare with working copy, we can compare the difference between the files in the working copy and version 1.

Finally, all the content has been recorded as animation files , you can refer to.

If you have any comments about this tutorial, you can discuss it here.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327033590&siteId=291194637