SVN Quick Start 1--svn installation and Common commands

Source: Internet
Author: User

I believe everyone has used SVN or heard of it? I will not talk about the benefits of it here, but I will talk about it on the Internet. Because it is version control, I personally think that the design principle does not need to be understood too much, just need to understand common sense. The younger brother, Google, hasn't found an article about quick start for a long time. In desperation, I read several long articles and finally learned a little bit. Next I will write a series of SVN Quick Start series. Because it is a quick start, I generally only talk about operations. (For details, refer to the series 2_subversion)

First, we download the svn Installation File, enter the URL: http://subversion.tigris.org, find... more downloads ..., find the one for Windows to download. Note that there are two versions of Apache 2.0 or Apache 2.2. You can download the same version as the Apache server on your computer.

After the installation is complete, enter SVN -- version in the command line to check whether the installation is successful, and check whether the svn installation directory is added to the path in the system variable. For example:

Then, create a database (repository) on the server ). A. manually create a folder on the hard disk.

B. Enter the svnadmin create + warehouse directory in the command line. Create a version library.

At this time. The folder where the repository is located contains several more files, indicating that the repository is successfully created.

SVN is ready on your computer. The following describes several common commands of SVN: import, checkout, commit, update, and mkdir.

When executing import, commit, update, and mkdir, SVN needs to record operation logs. Method 1: add an svn_editor variable to the system environment variable. The value of this variable is the notepad that comes with the system: notepad. 2. Create a log.txt as a log. (Method 2 is recommended, so I will use method 2 below ).

To facilitate operations under the command line, first set SVN to allow anonymous accounts to perform read and write operations: There is a file svnserve under the conf directory of the repository. conf, which is opened in Notepad. You can see a line: # anon-access = read, which means anonymous users have read permission. Remove the annotator. This line takes effect. Add a row: Anon-access = write, which grants anonymous users the write operation.

First, start the service: svnserve-d-r k: \ repository, which means that SVN uses this directory as a repository and listens to client requests. -D serves as the backend mode, while-r serves as the repository path of the specified server.

Create a new command prompt and run the mkdir command to create a virtual directory for test in SVN: SVN mkdir SVN: // localhost/test1-f k: \ log.txt

 

 

Create a new text1.txt file. :

Run the command line to go to the test directory, run the import command, and upload test to the svn server.

The following describes the checkout command.

Create a new folder named Test2, go to the folder through the command line, and run: SVN checkout SVN: // localhost/test1. Note that the check operation does not need to write logs.

 

Next we will talk about the commit command.

To modify the text1.txt file under checkout.

 

Run the commit command: SVN commit text1.txt-f k: \ log.txt on the command line.

Finally, let's talk about the update command: Execute SVM update text1.txt to obtain the latest version of text1.txt.

 

 

 

At this point, the basic SVN commands have been completed. Do you think it is quite troublesome? It doesn't matter. The next article will introduce SVN operations in windows.

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.