SVN learn the basic operation of the SVN command line

Source: Internet
Author: User
Tags svn update

http://huihai.iteye.com/blog/1985751

The previous section has completed the SVN installation and has done some simple things with the command line.

1. When SVN is installed, the SVN Manager will create a new project factory in the root directory of SVN to store the corresponding project, and we have an example project called OA, that is, the project name is OA. Managers will then use commands in the Command line window

SVN code
    1. Svnadmin Create OA

Create an SVN OA factory. Such as:

At this time in the D:/svn/root directory there will be an OA folder, where the OA folder specifically for OA items for the purpose of the content and version information. As shown in the following:

2, in the OA folder there is a folder called conf,conf inside there are three files are more important, they three are SVN specifically used to do the rights control, that is, Authz, passwd, svnserve.conf. Some data is defined in the svnserve.conf file, such as

SVN code
    1. Anon-access = Read
    2. auth-access = Write

The above command defines that only anonymous users are allowed to read by default (anon-access = Read) and authorized users can write (auth-access = write).

SVN code
    1. password-db=passwd

This command defines the SVN user and password to be stored in the file passwd. Create a user-password correspondence.

SVN code
    1. Authz-db = Authz

This command defines the authorization file to be placed in the Authz file. Determine which files each user can access.

3, after the management staff to create an OA plant, the project manager will create an OA project, if the project is created under the D:\study_source\svn\oa. The basic structure of this project would be:





After the project manager has finished creating the project, it is time to import the corresponding project into SVN, which is used at the command line.

SVN code
    1. SVN import-m "OA first" OA Svn://localhost/oa

Import the OA project into the specified directory, such as:

At this point, there will be a failure of authentication, the cause of this problem is because we are not logged in SVN, and do not create SVN username and password, can let anonymous users can read and write to SVN, this modification needs to be modified in the svnserve.conf file. Change the # anon-access = read to anon-access = Write, then save. Then execute the above command at the command line to set the success, such as:


4, through the above Operation project manager has put a project called OA into SVN's OA factory for management, this can be done by the developer of OA svn checkout operation, suppose there is a folder called Oa_d, This folder is a virtual one that is designed for developers to use, such as:


There are two developers in folder Oa_d, 01 and 02, respectively. Such as:

At this point 01 development agent on his machine can be on the server OA project check out to his machine, here we are check out to 01 folder. The commands used are as follows:

This allows you to put the corresponding items in the 01 folder, such as:

At this point 01 developers can edit the project, if 01 developers in the Web directory to create a new login.html file, and then add some content inside, casually write the content, after the completion of the development can be through SVN add to submit the corresponding changes to the SVN OA factory, such as:

Then use the SVN commit command to commit the corresponding action, as shown in:


5, add after the completion of the SVN server in the OA factory has a file LOGIN.HMLT. If a developer 02来 for development, then he can use SVN checkout as developer 11 to checkout the OA project to the local computer, as shown in:


After the project is removed, the developer modifies the file login.html, and 01 of the data submitted by the developer is the 0101010101010101,02 developer who added data 020202020202, modified as follows:

After the modification is complete, 02 developers use the SVN commit command to submit the corresponding data, such as:


When the submission is complete, Developer 01 will be able to use the command SVN update to get the changes made by developer 02 back to their computer if they want to modify the login.html file again. Such as:

When this is done, Developer 01 then opens the file login.html file, with the content of 02 people added.

This allows 01 and 02 developers to submit changes to the project through SVN update and SVN commit two commands.

SVN learn the basic operation of the SVN command line

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.