Install, configure, and use the svn client (Windows)

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

1. Go to the svn official website to renew. Create D:/SVN and enter svnadmin in the command line Directory (D:/subversion/bin /).
Create D:/SVN/repos1. If it is successfully created, a repos1 directory will be added under D:/SVN.

 

2. Run SC create svnservice binpath = "/" D: /subversion/bin/svnserve.exe/"-- service-r d:/SVN" Start = auto

 

3. Permission Configuration:
All users can perform any operation before permission configuration, which is not allowed in many cases. When creating a repository, Several folders are generated under the repository directory (for example, D:/SVN/repos1). configuration information is stored in the conf file, including three files:
Authz: access permission Configuration
Passwd: user name and password configuration
Svnserve. conf: basic configuration information
(1) Configure svnserve. conf first, and remove the comments before the configuration items. The final content is as follows:
[General]
# Anon-access = read
# Auth-access = write
Password-DB = passwd
Authz-DB = authz
The meanings of these parameters are described in detail. Anon-access and Auth-access are respectively used to control access to anonymous users and authenticated users, password-DB indicates the path of the user's password file, and authz-DB indicates the path of the permission configuration file. Another parameter, realm, is used to specify the authentication domain to which the warehouse belongs. By default, each warehouse is located in a different domain (each warehouse has a unique UUID). Therefore, we can leave this item unspecified, unless multiple repositories need to share the same passwd configuration.
(2) the configuration of the passwd file is very simple. The format is as follows (username and password are used before the equal sign ):
[Users]
# Potter = 123
# Sally = 123
Sunxiaoyong = 11111111 [a1]
(3) You can create a user group and precisely configure the access permissions of a user or user group to a file or directory. The following is an example:
[Groups]
# Harry_and_sally = Harry, Sally
 

[/]
Sunxiaoyong = RW
* = R [a2]

# [/Project1]
# * =
# Harry = RW
# Sally = r

# [/Project1/Foo]
# Sally =

# [/Project2]
# @ Harry_and_sally = RW
# Guest = r
The file content is actually easy to understand. Groups is used to define user groups, followed by specific resource access control./indicates the root directory of the Repository. * indicates all users. The @ symbol must be added before the user group, r indicates readable, W indicates writeable, and empty on the right of the equal sign indicates no permission. NOTE: For the directory structure, when a user accesses a resource, SVN will first check whether there is access control for the resource directly. If not found, it will inherit the access permission of the upper-level directory, so it is recursive.

In addition, when we have multiple warehouses, we will find that the user accounts of these warehouses are the same in most cases. Therefore, we can put the passwd file in a public place, then, point the password-DB configuration of all repositories to the file. Correspondingly, authz-dB can also share a file, but you need to specify the repository When configuring specific access control, as shown below:

[/]
* = R
 

[Repos1:/project1]
* = R
Harry = RW

[Repos2:/project1]
* = R
Sally = RW
The preceding configuration indicates that everyone has the read permission on the root directory of all repositories, but only Harry has the read and write permission on Project 1 in repository repos1, only Sally has read and write permissions on project1 in the repository repos2.

 


--------------------------------------------------------------------------------

[A1] creating a user

[A2] Set permissions

After installing and configuring the svn server, how can I use SVN? In Windows, the most common SVN client is tortoisesvn, sometimes referred to as tsvn.

Tortoisesvn Installation

You can.

After the download, install. Restart the machine to make the directory icon take effect.

In resource manager, right-click any location and choose SVN checkout from the shortcut menu.

SVN operation procedure

The general process for developers to use SVN for development is:
Checkout (check out) project
--> Update a file or directory --> Update
--> Modify a file or directory -- commit (submit) Change
--> Add a file or directory --> Add (ADD) file or directory --> commit (submit)
--> Delete a file or directory --> commit (submit) upper-level directory

Here, checkout is performed only once, and the update, commit, and add operations are often used as needed.

Checkout (check out) Operation

In resource manager, right-click any location and choose SVN checkout from the menu ".

In the displayed dialog box, enter the svn string in the URL of repository: format"Protocol: // ip: Port/version Library/project/directory". Enter according to the actual situation, such as http://code.google.com/p/google-web-toolkit/source. If you have any questions, contact the svn server administrator.

Enter the local code directory in "checkout directory". Select an empty directory or a new directory. SVN clears all files in the directory. After entering the information, click "OK.

If necessary, you will be prompted to enter the user name and password. After "Save authentication" is selected, you can log on automatically later without losing your password.

Checkout... Sometimes it takes a long time. End, click "OK ".

Update operation

In resource manager, select a local directory or file, right-click the menu, and choose SVN update ". The system will prompt whether the file needs to be updated. Click "OK" to complete.

Commit (submit) Operation

Submit the changed files or directories in the local directory to the version library and use commit. To add a new file or directory, you must first add it and then commit it. Delete a file or directory, and commit a level-1 directory.

In resource manager, select a local directory or file, right-click the menu, and choose SVN commit ".

The interface is displayed in the upper and lower boxes. Enter the description text in the above box. We recommend that you write the version number or reasons for the change for future search. The content to be submitted is listed in the following box. There is no content to submit. A text description is displayed in the following box. Click "OK ".

The submission is complete and the result is displayed. Click "OK ".

Resolve code conflicts

If the message "you have to update your work copy first." appears in red during commit, the file in the version library has been modified by others. Click "OK" to exit. Execute update and then commit.

If the modified Code does not conflict with the updated code, it is automatically merged. If the conflict occurs (for example, the same line of code has been modified), a red warning is displayed, and several file records conflict occurs. In general, do not directly edit conflicting files. Follow these steps to manually resolve the conflict.

In resource manager, select the file that conflicts with the commit file and right-click the file and choose edit conficts from the shortcut menu ".

The interface is divided into three parts: "theirs", "mine", and "merged, "modified by others", "modified by me", and "merged result. We want to combine the "modified content by others" and "modified content by me" to form a "merged result ".

Merge is generally divided into four situations:

  • Retain "My changes" and discard "others' changes ". Right-click the line in the mine box and click "use this text block ".
  • Discard "My changes" and keep "others' changes ". Right-click the corresponding row in the theirs box and click "use this text block ".
  • Keep "My changes" and "others' changes" at the same time, and put "My changes" in front. Right-click the line in the mine box and click "use text block from mine before theirs ".
  • Keep "My changes" and "others' changes" at the same time, and put "others' changes" in front. Right-click the line in the mine box and click "use text block from theirs before mine ".

After merging, press Ctrl + S to save the disk and exit.

Then, in resource manager, select the conflict file and right-click the file and choose resolved from the shortcut menu to mark that the conflict has been resolved. The system automatically deletes the files created due to the conflict. Now, you can continue the commit operation.

Add operation

To add a new file or directory, you must first add it and then commit it.

In resource manager, select the newly added directory or file, right-click the menu and choose add ".

Indicates the file to be added. Click "OK" to continue. The end point is "OK ".

Delete operation

Delete a file or directory, and commit a level-1 directory.

This article from http://jijian91.com Original article http://jijian91.com/blog20061215/tortoisesvn.html

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.