SVN configuration and use

Source: Internet
Author: User
Tags svn client svn update version control system tortoisesvn

SVNIs a free, open source, cross-platform version control system. It is a general system that can be used to manage any types of files, This includes the program source code.

SVNThere are two ways to run, one is based onApache Http ServerAnd the other isSVN Standalone Server. Generally, it is recommended to useApache Http ServerOfSVNTo do this:

A.The WebDAV protocol can be used.

B.You can use a browser as a client tool to browse the source code repository.

C.It is easy to support SSPI (Windows domain authentication) and LDAP, which are supported by Apache itself.

D.A comprehensive Apache Security Authentication System, such as SSL encrypted connections, can be obtained.

This section describes how to install and configure the SVN client and server in Windows. This is a quick manual. For detailed configuration information, see other materials.

1. install Apache

Go to http://httpd.apache.com/to download the latest version of Apache For Windows, such as apache_2.0.52-win32-x86-no_ssl.exe. NOTE: If IIS is already running, you must first disable (), change the IIS port (), or change the Apache listening port () after installation (). If the listening port is not changed after Apache is installed, it does not conflict with IIS. Open http: // 127.0.0.1/in the browser to check whether the Apache welcome page is displayed.

Ii. Install SubVersion

To begin

3. Configure Apache

1. At the windows command line prompt, go to the bin directory under your Apache installation directory and use the command to create an Apache authenticated user:
Htpasswd-cm <You want to create the absolute path of the authentication file, such as D: "Apache2" conf "usr_pwd> <New User Name>
Then fully enter the password to confirm. Use the-c parameter to indicate the new file and the first user.Usr_pwdUse the MD5 Algorithm to encrypt the password.
If you want to create a user later, use the-B parameter, for example:
Htpasswd-B <You want to create the absolute path of the authentication file, such as D: "Apache2" conf "usr_pwd> <New User Name> <New User's initial password>
2. Open the httpd. conf file in the conf directory under the Apache installation directory.
Add the following configuration at the end:
<Location/svntest>

DAV svn

SVNPath "F:" svn_repository "test"

AuthType Basic

AuthName "Subversion for testing"

AuthUserFile "D:" Apache2 "conf" usr_pwd"

Require valid-user

</Location>

/Svntest:Is the string written after the server address in the URL of repository when the client exports the svn Library (checkout), such as http: // 192.168.50.106/svntest

SVNPath:Is the path of the SVN library you want to create. The method is described in the next section.

AuthType:Indicates the authentication type, as well as the SSPI option, which must be configured separately.Basic.

AuthUserFile:That is, the absolute path of the authentication file you created.

4. Configure SubVersion

At the windows command line prompt, run the following command:
Svnadmin create <Your svn repositoryPath, such as F: "svn_repository" test>
Create a SVN library.

5. install and use TortoiseSVN

Download TortoiseSVN online as the SVN client, such as: TortoiseSVN-1.2.2.4295-svn-1.2.3.msi. Follow the prompts to execute the default installation, which is combined with the window Resource Manager. Right-click the directory of the SVN library you want to store and download->SVN CheckoutThe SVN Export Dialog Box is displayed.

Enter<Server address + Location>And then click OK,

If this is the first checkout, the authentication dialog box is displayed.Authentication, Enter the user and password to start creating in Aapche to pass the authentication,

There isTortoiseSVNSub-menu, including configuration and use of all functions of TortoiseSVN. This section describes several common applications:

1. Update operations

The client must keep the files on the server consistent at any time. Therefore, files in the database must be updated frequently. In your SVN repository directory, right-click and you will seeSVN UpdateMenu. After you click it, TortoiseSVN will automatically search for unupdated files and download them. If the file you downloaded is inconsistent with your existing file,TortoiseSVNThe non-conflicting parts are automatically merged.MergedIf any conflict exists, a prompt is displayed.Confilicted,

2. Submit the operation

If the client modifies and saves an existing file, the icon of the file will be an exclamation point. Right-click the Directory andSVN CommitOption. After you click it, TortoiseSVN will automatically search for the files you modified and list them. You can enter comments, such as the reason and time for modifying the files, select the file to be submitted in the check box below, and click OK to complete the submission.

3. Compare files

If the file icon in your SVN library directory is"√"In this case, TortoiseSVN prompts that your files are inconsistent with those on the server. You can right-click the menu and choose>TortoiseSVNSub-menu-> DiffYou can find the exact difference through the file comparator of TortoiseSVN.

4. add and delete files

The operations on the client to delete files in the database are as follows:
Right-click and choose>TortoiseSVNSub-menu-> Repo-Browser,

By right-clicking the menu in the figure, you can check the files in the SVN repository on the server (Show Log), export (Checkout), and Create Folder (Create Folder ), add File, Add Folder, Delete, and so on.
UseRepo-BrowserMenuIt has a very powerful function, which is to operate the database on the server directly.

5. Conflict handling

For the same file in the library, if both of them modify the same part of the file, then the submitted person will receive a warning that the file requires updates when submitting the file, after the update,TortoiseSVNA message is displayed, indicating that the current working version conflicts with the files on the server. The file icon is an exclamation point. Right-click the file and chooseTortoiseSVNSub-menu-> Edit Conflicts,The edit box will pop up.TortoiseMerge:

The upper left is the Server File displayed, the upper right is the local file displayed, and the following is the file you processed after the mergeTortoiseMergeThe modifications made in will be reflected in the local file, and then can be submitted. Of course, you can select another editing tool to edit local files to avoid conflicts with files on the server.

6. Lock the file

To prevent conflicts,TortoiseSVNProvides the file lock function. As the name suggests, after a file is locked, only users holding the lock can submit the file. Other users are prompted that the file is locked by other users and cannot submit the file. You can use the lock function by right-clicking the file to be locked and enteringTortoiseSVNSub-menu-> Get Lock...,

In the upper text box, enter the reason for locking the file, select the file to be locked, and click OK.
Of course, if the person holding the lock has a business trip, you may not ask his user and password, but you must modify the file he is locking,TortoiseSVNProvided inSteal the locks.After selecting the check box, you can become the lock holder of the file. Of course, you have to be prepared to explain the reasons for returning the original lock holder.

7. Version Restoration

If you do not want to submit a new version but restore it to the original version, you can right-click the file to be restored to the original version and useTortoiseSVNSub-menu-> Update to Revision...Function,

Enter the version number you want to restore in the text input box.

8. Others

TortoiseSVNProvides complete logging, that is, buttons that are frequently seenShow LogYou can view and follow the modification records of a file at any time. You can right-click the object and chooseTortoiseSVNSub-menu-> Blame....TortoiseSVNIt will provide you with reference in the most detailed way.
TortoiseSVNSub-menu-> SettingsThe dialog box includesTortoiseSVNCommon configurations, including icon style and server proxy configuration.

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.