SVN installation and configuration process instructions

Source: Internet
Author: User
Tags tortoisesvn

SVN configuration process instructions

1. Install the independent server svnserver

1.1 obtain the Subversion server program

Download the latest server installer from the official website (http://subversion.tigris.org. The latest version is 1.4.6, specific in: http://subversion.tigris.org/servlets/ProjectDocumentList? Folderid = 8100 & expandfolder = 8100 & folderid = 91. Find the version for Apache 2.2.x.

I have uploaded the files to the following space for convenience. You can download them here:

Http://dl.dbank.com/c0ezh34xs5

1.2 obtain the tortoisesvn client program

Get the latest tortoisesvn from the official website http://tortoisesvn.net/downloads. Tortoisesvn is a client program used to communicate with the subvers server. Subversion comes with a client program svn.exe, but tortoisesvn provides better operations and improves efficiency.

Here I upload the file to the following space, which can be downloaded directly at the following URL:

Http://download.csdn.net/source/3447907

Http://dl.dbank.com/c0b5oipgsa

2. Install the server and client

First, confirm that Apache has been installed.

Next, install the subversion (SVN) server and client. Install the two downloaded software packages directly. First install svnsetup.exe on the server side, and then install the client program. The tortoisesvn package first installs the TortoiseSVN-1.6.5.16974-win32-svn-1.6.5.msi software, and then installs the LanguagePack_1.6.5.16974-win32-zh_CN.msi Language Pack. Note that the client needs to be restarted after installation.

3. Create a version Library

To run the Subversion server, you must first create a version Library (repository ). The version library can be seen as a place where data is centrally stored and managed on servers.

Create a version library. Create an empty D: \ SVN folder as the root directory of all version libraries. Then, go to the command line and switch to the bin directory of subversion. Run the following command:

Svnadmin createe: \ SVN \ repos1

This command creates a version library repos1 under E: \ SVN. Some folders and files are automatically generated under repos1.

We can also use tortoisesvn to perform this step graphically:

First, create an empty directory e: \ SVN \ repos1. Note that it must be empty. In the repos1 folder, right-click and choose tortoisesvn> Create repository here... ", then you can select the version library mode. Here you can use the default fsfs, and then create a series of folders and files, which are the same as those created on the command line.

4. Run an independent server

At this time, the Subversion service has not started yet, but the version library has been created through its command. Enter the following in the Command window:

Svnserve.exe -- daemon

Svnserve will wait for the request on port 3690, and the -- daemon (two dashes) Option tells svnserve to run in daemon mode, so that it will not exit before manual termination. Do not close the command line window. Close the window will stop svnserve.

To verify that svnserve works properly, use tortoisesvn-> repo-browser to view the version library. In the pop-up URL dialog box, enter:

SVN: // localhost/SVN/repos1

Click "OK" to view the directory tree structure of the repos1 version library, but repos1 is an empty database.

You can also use the -- root option to set the root location to restrict the access directory of the server, so as to increase security and save time for inputting the svnserve URL:

Svnserve.exe -- daemon -- root drive: \ path \ To \ Repository

In the previous test, svnserve runs as follows:

Svnserve.exe -- daemon -- root E: \ SVN

Then the browser URL in tortoisesvn is reduced:

SVN: // localhost/repos1

5. Configure user permissions

Open the E: \ SVN \ repos1 \ conf directory in the text editor and modify svnserve. conf:

Set:

# Password-DB = passwd

Changed:

Password-DB = passwd

Remove the # annotator. Note that there is no space before it.

Then modify the passwd file in the same directory and add an account:

Set:

[Users]

# Harry = harryssecret

# Sally = sallyssecret

Add an account:

[Users]

# Harry = harryssecret

# Sally = sallyssecret

Test = test

6. initialize the imported data

The following describes how to import our data (project) to this version library and manage our data in the future. Any of our changes are recorded by the version library. Even if we lose or correct the data, the version library can help us retrieve the data.

For example, I have a flower folder under D: \ wwwroot, which stores the message book program I wrote. In this folder, right-click "-> tortoisesvn-> Import..." And enter "SVN: // localhost/repos1" in "URL of repository" in the pop-up dialog box ". In "Import message", enter "initialize Data Import" as the comment.

After clicking OK, enter the account. Enter test in both the user name and password. After completion, all the content in the flower is imported to SVN: // localhost/SVN/repos1.

We can see that there is no change in E: \ SVN \ repos1, and even a guestbook folder is not created. The only change is that the capacity of E: \ SVN \ repos1 has increased. In fact, the content in the source guestbook has already been imported into the repos1 version library, and the source flower folder can be deleted.

Note that this step can be performed on another client with tortoisesvn installed. For example, if the IP address of the host running svnserve is 172.17.21.240, the content entered in the URL section is "SVN: // 172.17.21.240 ".

7. Basic operation procedure

7.1 check out ),

Extract the version library to a working copy:

To any empty directory, such as creating an empty folder F: \ work in partition F. Right click-> svncheckout ". In "URL of repository", enter "SVN: // localhost/SVN/repos1" to get a working copy of the content in the flower.

If you want to create a folder on the client, you can directly create a folder in the workspace you want to create, and then "right-click-> SVN checkout ". In "url ofrepository", enter "SVN: // localhost/SVN/repos1" to get a working copy of the content in the flower.

7.2 check in/commit)

Make changes in the work copy and submit:

Open a file in the flower copy and modify it. Right-click and choose SVN commit ...". In this way, the modifications are submitted to the version library, which stores the submitted data as needed.

Right-click the modified file and choose tortoisesvn> show log to view all submissions to the file. Right-click different revision entries and choose "compare with working copy". We can compare the differences between the files that work copies and the selected revision version.

7.3 Export (Export)

We want to provide a project to the customer. Of course, we can use the export in the tortoisesvn menu to create a folder. Right-click the folder tortoisesvn and choose export...

 

 

 

The following are some common configuration problems:

1. Create a version Library

Select where you want to put the version library, for example, to put the version library in the D:/SVN/repo folder in this example. Now we can right-click this folder, choose createrepository here from the torisesvn pop-up menu,

After a while, a dialog box will pop up, indicating that the creation is successful. The default format is fsfs.

 

 

2. Run svnserve as a Windows service. From subversion 1.4, svnserve can be installed as a Windows service.

Run the following command at the command prompt:

SC create svnserve binpath = "C:/program files/subversion/bin/svnserve.exe -- service -- rootd:/SVN/repo" displayname = "Subversion" depend = TCPIP start = auto

 

3. svnserve Certification

By default, svnserve only provides the read and access permissions of anonymous users. That is to say, you can only copy jobs from the checkout and update libraries, but cannot make any changes to the copy jobs, to better use and manage SVN, we add user verification to SVN.

Modify senserver. conf:

Anon-access = write indicates that anonymous users have the write permission.

 

4. SVN access

SVN: // access the svnserve server through the unauthenticated TCP/IP custom protocol.

Because we have located the root directory to the repo folder when running svnserve, we can directly enter SVN: // localhost/for access when using SVN, if the -- root option is not added, the address must be SVN: // localhost/repo. For access from other computers, you only need to change localhost to the IP address of the svn server.

 

5. First Import)

Create an import folder with three directories: design, release, and trunk. Right-click the import folder and click Import, after the import, you can delete the folder.

 

6. Check for the first time (checkout)

You need to check out the code (checkout) of the version library to a folder and get a copy of work. You can modify the copy. You can use the checkout command. Note: Do not check out the folder used for import. Otherwise, an error occurs during file overwrite. If necessary, delete all content in the original folder first, then check out (checkout ).

The specific operation is to obtain the development source code, for example, in E:/workspace, right-click in this folder, and select SVN checkout in the pop-up menu ..., The following page is displayed (Figure 3-3-1), because we only need to develop code, so we need to locate the address in the trunk folder, and click OK by default.

 

7. Submit the modification (COMMIT)

The red exclamation point indicates that the file has been modified.

 

8. rollback (update to reversion)

This situation is very likely to happen, that is, when you modify the code, you find that the program has a large vulnerability, and it is difficult to modify it, at this time, you can roll back your project to the previous version. The specific operation is: Right-click the folder or file you want to roll back, and select update toreversion in the tortoisesvn pop-up menu... Then, a page is displayed. For example, if you want to roll back to version 10th, you only need to enter the corresponding version number in revision and click OK.

 

9. Branch and tag

To a certain extent, we feel that this version is mature enough and can be used for release. We can save this version as a backup and then modify it, if a major problem occurs, you can use the above version immediately. The operation is as follows: first, the project checkout in trunk is moved to a folder from the version library, and then right-click the folder under checkout. In the tortoisesvn pop-up menu, select branch and tag ...,

Fill in the path in the to URL. Since the version can be released, we will put it in the V1.0 folder in the release folder. If this folder is not available, it will be automatically created. Then, write the log in the following log window and click OK. Then we can use the repositorybrower in tortoisesvn to check whether it is added.

 

10. View All versions (show log)

Go to the checkout directory and right-click "show log" to view all versions.

 

11. Export (Export)

We want to provide a project to the customer. Of course, we can use the export in the tortoisesvn menu to create a folder. Right-click the folder tortoisesvn and choose export...

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.