Subversion quick start tutorial (SVN)

Source: Internet
Author: User
Tags tortoisesvn collabnet
Subversion quick start tutorial (SVN vs CVS)
The Subversion animation tutorial mentioned in this article is not available. You can discuss any Subversion issues.

Subversion is a new generation of version control tools. It is not only used for program source code management, but also widely used in other jobs that require collaborative data management. For example, some people use Subversion to jointly write music scores, and artists use it for joint plotting, the document writer writes a masterpiece together.
For beginners who want to learn Subversion, you can take a look at the fastest Subversion getting started tutorial.

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. An animation tutorial is provided here.

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. Software Download
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 can be planted svn-1.2.3-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, select Official version for Win2k/XP or higher, then select the current highest stable version of the Installation File TortoiseSVN-1.2.4.4479-svn-1.2.3.msi on the download page of sourceforge.

2. server and client Installation
Install the server and run svn-1.2.3-setup.exe directly. Follow the prompts to install svn-1.2.3-setup.exe. In this way, we have an environment where the server can run.
Install TortoiseSVN and run the TortoiseSVN-1.2.4.4479-svn-1.2.3.msi directly
Follow 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, in order to see the effect immediately, restart the machine.

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
Go to the E: \ svndemo \ repository \ conf directory and modify svnserve. conf:
# [General]
# Password-db = passwd
Changed:
[General]
Password-db = passwd, modify the passwd file in the same directory, and remove the following three lines of comment:
# [Users]
# Harry = harryssecret
# Sally = sallyssecret
Finally changed:
[Users]
Harry = harryssecret
Sally = sallyssecret
5. Run the independent server
Run the following command in any directory:
Svnserve-d-r E: \ svndemo \ repository our server program has started.
6. initialize the Import
Go to the project root directory we want to import. In this example, E: \ svndemo \ initproject. the directory contains a readme.txt file:
Right-click TortoiseSVN and choose Import...
Enter "svn: // localhost/trunk" in the URL of repository"
After OK, the directory remains unchanged. If no error is reported, all the data has been imported to the version library we just defined.
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/trunk in URL of repository, in this way, we get a copy of work.
Make changes in the work copy and submit:
Open readme.txt, right-click it, and choose Commit ..., In this way, the modifications are submitted to the version library and can be run.
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.
Finally, all the content has been recorded as an animation file for your reference.
If you have any comments on this tutorial, please reply here.

Performance Comparison Between CVS and SVN
The test results are amazing today.
Action CVS SVN
Check out small file set 1 m 17.32 s 26.96 s
Check out large file set 7 m 16.92 s 5 m 35.01 s
Tag small file set 1 m 29.30 s 0.88 s
Tag large file set 18 m 52.45 s 0.86 s
Update small file set 44.46 s 4.91 s
Update large file set 8 m 53.39 s 38.62 s
Create branch (small set) 1 m 27.99 s 0.80 s
Create branch (large set) 21 m 2.93 s 0.69 s

Reference content As it is known, before getting acquainted with SVN, our company had worked with CVS for long enough. we know CVS from both user and developer points of view. approximately at the same level we had got acquainted with SVN, and undoubtedly we have an opinion to share with you concerning the question "what system is better? ".

It is worth noting, that the work on the creation of the IDE plug-in for SVN had started at numerous user requests. however, our own motivation had also played a considerable role in starting work with SVN, since publications appeared that SVN is a substitute for CVS, which eliminates all its problems and other comings. unfortunately, to our point of view, SVN is not a substitute for CVS and all the more it does not eliminate its own comings. moreover, it even yields to CVS. figuratively, CVS and SVN can be compared as C ++ and Java. obviusly, both CVS and SVN are more powerful than SourceSafe, as well as C ++ and Java are more powerful than Basic. CVS represents almost all functionalities of a source control system, though not always in a convenient and apparent manner. SVN, patching and expanding some CVS functionalities, simply does not contain some important functions. for example, the creation of tags and branches is dubious, and no means are provided to your y others that you are editing a file. it is similar to what the developers of Java have done: they have decided for you that pointers are not necessary, and there is no need in operator overloading etc.

Thus, as for now SVN cannot be considered a CVS substitute. it is a different system, similar to CVS. it has unique functions, which can serve as a reason for its usage. these functions make it more suitable for some development environments, for example for PowerBuilder. below you can find comparative advantages and disadvantages of these systems. it is assumed that in relation to the remaining items the systems are similar. on the green background "advantages" of a system in relation to its competitor are presented, and "disadvantages" are presented on the pink ground. if you are facing the problem of choice, it is recommended to try both systems, paying special attention to the items below. you may also look to some discussion between Subversion developers and Pushok staff.

Why does this project exist?
To take over the CVS user base. Specifically, we're writing a new version control system that is very similar to CVS, but fixes should things that are broken. See our front page.

Is Subversion proprietary? I heard that it belongs to CollabNet.
No, Subversion is open source/free software. collabNet pays the salaries of several full-time developers, and holds the copyright on the code, but that copyright is an Apache/BSD-style license which is fully compliant with the Debian Free Software Guidelines. in other words, you are free to download, modify, and redistribute Subversion as you please; no permission from CollabNet or anyone else is required.

What is Subversion's client/server interoperability policy?
The client and server are designed to work as long as they aren't more than one major release version apart. for example, any 1.X client will work with a 1.Y server. however, if the client and server versions don't match, certain features may not be available.

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.