SVN entry and Configuration

Source: Internet
Author: User
Tags subversion client svn client svn update

SVN, or Subversion, is a free and open source version control system that can recover data to earlier versions or check the data modification history. The data can be source code, it can also be another type of file.

Before the emergence of SVN, CVS was a de facto standard for open-source version control tools in the world. However, CVS has some inherent defects and it takes a lot of effort to fix these defects. Therefore, the initiators of SVN, Brian behlenddorf and CollabNet, decided to rewrite a version control system to retain the basic idea of CVS, but to correct the errors and unreasonable features. As a result, SVN emerged as the successor of CVS. SVN designers strive to win the favor of CVS users through two ways: Maintain the design of open-source systems and the interface style as similar as possible to CVS, while trying to make up for many notable defects of CVS. As a result of these efforts, migration from CVS to SVN does not require significant changes, so more and more people have chosen SVN.


I. Use of the Client
1.1 in Linux (Ubuntu)
1.2 In Windows
1.3 Use SVN + ssh authentication in Linux (related materials not found @_@)
1.4 Use SVN + ssh authentication in Windows
Ii. Server Configuration
2.1 configure svnserve in Linux
2.2 configure svnserve in Windows
2.3 configure svnserve + ssh in Linux
2.4 configure svnserve + ssh in Windows (Cygwin, omitted)
2.5 APache-based SVN server configuration in Linux
2.6 APache-based SVN server configuration in Windows
3. Create a version Library
3.1 create a version library in Linux
3.2 Create a version library in Windows

Most people use SVN from the client. The following describes how to use the client first. Assume that the SVN server is ready. The folder address is http: // domain/svn/trunk/myproject, the username is test, and the password is test. (If SVN is configured on the server side, access using the URL starting with svn: //; If SVN + SSH is configured on the server side, access using the URL starting with svn + ssh)

I. Use of the Client

1.1 Linux (Ubuntu) systems are generally used

1) First, install the svn client. use $ sudo apt-get install subversion in ubuntu (for other commands, see baigoogledu)

2) checkeout command: when used for the first time, use the checkout command to copy the Server Directory to the current local directory, and create a hidden folder to record version information:
[Working directory] $ svn checkout "http: // domain/svn/trunk/myproject" -- username test
Enter the password

3) svn update command: Get the latest version on the server
[Working directory] $ svn update (except for adding the url and user name and password for the first time, the system will remember it later)

4) svn add command: to add non-version-controlled local files to version control:
[Working directory] $ svn add hello. c

5) svn commit command: upload local files to the server

[Working directory] $ svn commit (if a new file exists, svn add first)

1.2 In Windows

1) install the client:

2) create a folder (working directory), right-click and select checkout, and enter the URL and user name and password.

3) Right-click the working directory and choose update.

4) Right-click the working directory and add

5) Right-click the working directory and choose commit.

1.3 Use SVN + ssh authentication in Linux(No related materials found @_@)

1.4 Use SVN + ssh authentication in Windows

(Refer to setting up svn servers in ubuntu and creating svn + ssh clients in windows)

1.4.0 install TortoiseSVN, Puttygen, and Pageant
Http:// /~ Sgtatham/putty/

1.4.1 convert Private Key format
1) copy the <username> key in Linux to windows and run Puttygen;
2) Select the menu conversions-> Import Key, select the file <username> key, and prompt "Enter passphrase for key". Enter the passphrase keyword used to create a public/private Key pair;
3) select Parameters as SSH-2 DSA or SSH-2 RSA-> Save private key-> Save file name as username> key. ppk.

1.4.2 establish the association between TortoiseSVN and Pageant, and add the private key to Pageant:
1) Right-click TortoiseSVN-> Settings-> Network-> SSH client, and enter:
C: Program FilesTortoiseSVNinTortoisePlink.exe
2) Right-click TortoiseSVN-> RepoBrowser and enter the URL:
Svn + ssh: // <username >@< SvnServiceIP>/usr/local/svn/trunk
3) Run Pageant, right-click the icon in the lower-right corner of the screen-> Add Key, and Add the private key file <username> Key. ppk.
-- If you do not want to cache the ssh password, steps 8th and 9 are not required. You only need to keep step 2, but you need to enter the password twice each time you go to the check out and check in folders, annoying you :)

Ii. Server Configuration

There are three options for deploying Web servers, from simple to complex

· Svnserve

· Svnserve over SSH

· Apache + mod_dav_svn module

The following describes svnserve in the simplest way.

[Update] Windows Server configurations can be installed with the visual SVN Server.


Reference link: VisualSVN series introduction (for detailed installation process introduction, I will not describe it here)

2.1 & 2.2 configure svnserve

Svnserve is a lightweight server that can communicate with the client through a custom stateful protocol based on TCP/IP. The client starts with svn: // or svn + ssh: // svnserve URL to access a svnserve server.

2.1 configure svnserve in Linux

2.1.0 Similarly, use the command $ sudo apt-get install subversion

2.1.1 svnserve acts as an independent daemon and listens for requests
$ Svnserve-d
$ # Svnserve is now running, listening on port 3690
-- You can use -- listen-port = [port number] to specify the port, or -- listen-host = [host name] to specify the host name.
Assume that you have created a version library in the/usr/local/repositories/project path (the establishment of the version library will be mentioned later). In this case, the client can use svn: // [host]/usr/local/repositories/project for access
-- You can use the-r option to limit the output of only version libraries in the specified path, so that client access is more concise:
$ Svnserve-d-r/usr/local/repositories
The client only needs to use svn: // [host]/project to access

2.1.2 use svnserve through inetd
$ Svnserve-I
-- In this case, svnserve tries to use the custom protocol to communicate with the subversion client through stdin and stdout. The default port is 3690. You can add the following lines in/etc/services:
Svn 3690/tcp # subversion
Svn 3690/udp # subversion
-- If you are using a classic Unix-like inetd daemon, you can go to/etc/inetd. add the following lines to the conf file. If a client connects to port 3690, inetd generates a svnserve process for service.
Svn stream tcp nowait svnowner/usr/bin/svnserve-I

2.1.3 Set built-in authentication for svnserve

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: 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.