Install SVN, configure Service self-start, and use SVN in Eclipse tutorial, svneclipse

Source: Internet
Author: User

Install SVN, configure Service self-start, and use SVN in Eclipse tutorial, svneclipse

> This article will do its best to describe all the steps and add them to help SVN beginners better understand and get started.

> What is version control?

Version control and Revision control were originally applied in the engineering design field. The purpose was to maintain the standards of the engineering blueprint and track the process from its birth to its final determination.

Used to record changes in the file content for query of modifications. Subvesion is a tool that implements version control, SVN for short. Like Tomcat, Subvesion belongs to the Apache Software Foundation.

Cloud cloud can find countless identical statements about some of SVN's excellent features, working principles, and other such theories on the Internet (or is far from each other. I will not mention this part here.

This article focuses on how to use SVN.

> Basic SVN operations

Checkout: it is used to completely Down a project created on the server end to your computer. This is the first step to participate in project development. It is generally executed only once.

Update.

Commit: submit local modifications to the server. Generally, a submission is executed once to implement a function and complete a module.

> Install and configure SVN

Install the server program

Apache maintains and updates the source code of Subversion. The source packages of each version can be downloaded at the address given below.

The best available version of Apache Subversion is: 1.9.5

: Http://subversion.apache.org/download/

If you want to download the installation msi program, go to the following address:

: Https://sourceforge.net/projects/win32svn/source=directory

If it is downloaded from the second address, it should be the installation program named: Setup-Subversion-1.8.9-1.msi.

That's it. Double-click to install.

Because I have already installed it, I will not demonstrate how to install it here. Note that when selecting the installation path, make sure the selected path is correct !!! No Chinese characters, no spaces, no special symbols !!!

After the installation is complete, the program automatically configures the environment variables ---> for example, the path D: \ SVN \ Subversion \ bin will last in my path.

Check whether the installation is successful. Open cmd and enter svn -- version in the command line. If the following information is displayed, the installation is successful.

Don't be alarmed if the word "svn is not an internal command" appears. Enter the environment variable, find the path in the system variable, and rewrite the bin directory of the SVN root directory, for example, my D: \ SVN \ Subversion \ bin;

Then confirm to save it. According to the test, this can solve the problem. Ask a gates if there is such a problem.

Configuration version Library

After the installation is complete and the environment is confirmed to be correct, we recommend that you complete the version library configuration.

We recommend that you create a new folder in the parent directory of the version library to create the Version Control Repository used by the project.

For example, my SVN is installed in D: \ SVN \ Subversion, So I create a new folder named "repository" under D: \ SVN, as the name suggests, I will use this folder as a repository. Save all project version repositories. The advantage of doing so is that you do not need to build an SVN server for every project frequently. This is a waste of effort.

How to Create a version library? This can be achieved through commands. The specific commands are as follows:

Svnadmin create [parameter: specified path]

For example, I have a folder named EmployeeManager under D: \ SVN \ repository to serve as a version library.

In the command line, you can enter:

Svnadmin createD: \ SVN \ repository \ EmployeeManager

After the command is correctly executed, the following files will appear in the EmployeeManager file:

Conf is the directory that stores the configuration files used by the version library;

Db is the directory for storing version database files;

Hooks is the directory for storing the version library hook program;

Locks stores database locks and tracks visitor directories;

Format record version

Self-sued ReadMe version Library

Then, to ensure normal checkout and update, commit needs to modify the configuration file: Find the svnserve. conf file in the conf folder and edit and open it.

The # anon-access = read marked in the figure. After you modify the read to write, cancel the # comment mentioned above and save and exit. This means the modification is successful.

After completing the preceding steps, you must enable the SVN service. The project file can be managed in response to client requests only after the service is started. Here we will introduce two methods to enable the SVN service.

One of them is directly enabled through the command line. The command format is as follows:

Svnserve-d-r [absolute path of the Subversion root directory]

By the way, parameter-d Indicates execution in the background, and-r indicates the root directory of the version library.

However, if the command line window is closed for the SVN service started in this way, the service is stopped, in addition to the inconvenience of Manual start every time, the Service may be accidentally closed but unknown. Therefore, we recommend the second method to solve this problem. That is, register the windows Service and enable the svn service when the computer starts.

To register the Windows service, you must use SC .exe. This is a built-in tool. Therefore, you can directly register the service using the following command in the command line (if the = sign appears, there is no space on the left and a space on the right ):

SC create [service name] binpath = "Path of the binary file required for running the service and the command line parameter for running the binary file" start = [auto or other] depend = [dependent Protocol]

According to the installation path, it should be as follows:

SC create svnserver binpath = "D: \ SVN \ Subversion \ bin \ svnserv.exe -- service-r D: \ SVN \ repository" start = auto depend = tcpip

If access is denied during command execution, you only need to use the Administrator permission to open cmd.

After confirming that the service is successfully registered, you can run the net start svnserver command (the service name is determined by your own command) to start it once. The Service will start with the computer.

Use SVN in Eclipse to control the version of the project

To use SVN in Eclipse, you must first download an eclipse SVN plug-in, which can be downloaded through the network.

You can also download the plug-ins from Eclipse. If you download the plug-ins from other places, put them in the dropins directory under the eclipse root directory.

Then we will use Import to find the SVN

Click Next>

Item 1

Enter the path of the project version library,

Select version Library

After that, the options for creating a project will appear,

After creating a project, right-click the project and select the Team tab. The operation prompt is displayed. For example, submit and update. So far, SVN installation configuration, service configuration, and connection to the project version library in Eclipse are complete.

Related Article

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.