Create and use SVN server-Example of document file management

Source: Internet
Author: User
Tags tortoisesvn

Source: http://blog.csdn.net/kupe87826/article/details/8139908

Reference: http://baike.baidu.com/view/183128.htm

Http://wenku.baidu.com/view/ed3e3435ee06eff9aef807ff.html

Http://blog.csdn.net/bluesmile979/article/details/3719511

Http://www.subversion.org.cn /? Viewnews-5

Http://www.cnblogs.com/chinafine/articles/1825892.html

 

Software environment: win7 System

 

Previously, I used to manage document files by copying, backing up, and pasting files. If the document is rarely used, it may take a long time. Sometimes one of my documents has several backups, And I am confused. So we need to find a tool to manage it. SVN is the first choice.

1. Brief Introduction to SNV

SVN (subversion) is a version management tool that has emerged in recent years and is the successor of CVS. Currently, most open-source software uses SVN as the code version management software.

Running Mode

SVN servers can run in two ways: independent servers and Apache. The two methods have their own advantages and disadvantages.

Store Data

SVN also stores version data in two ways: bdb (a transaction-safe table type) and fsfs (a storage system that does not require a database ). Because bdb may lock data when the server is interrupted, it is safer to use fsfs.

2. My choice

Because I am a standalone, I basically manage my own documents. Therefore, I select the independent server mode for running, and use fsfs (a storage system without a database) for storing data.

3. File Download and Installation

SVN Server Download: I downloaded wandisco subversion 1.7.6. I think this version is good. I have some problems with the win32svn version. It is strange to say that I cannot find the DLL or something. We recommend that you use wandisco subversion.

Download link: http://www.wandisco.com/ubersvn/download? Quicktabs_ OS = windows # windows

Client: tortoisesvn. You can find it online. My version is tortoisesvn 1.6.5

Install the server and client.

 

4. Basic server settings

(1) create a SVN repository (repository1)

Run cmd

Cd d: \ Program Files \ wandisco \ Subversion

Svnadmin create F: \ svntest \ repository1 -- FS-type fsfs

(Do not forget the storage method: fsfs is a storage system that does not require databases ).)

 

This will generate some files in F: \ svntest \ repository1. The conf directory is the directory for storing permission-related files; the DB directory is the data files of all version control; the hooks directory is the directory for storing hook script files; and the locks directory is used to hold the data directory locked by the Subversion file library, the client used to track access to the file library. The format file is a text file with only one integer in it, indicating the version number of the current file library configuration;

(2) configure the svn Server

 

Open the F: \ svntest \ repository1 \ conf directory and open svnserve. conf to find the following:

[General]

# Password-DB = passwd

# Anon-access = read

# Auth-access = write

# At the beginning of each line, and change read to none. The second line specifies the authentication file name, that is, the passwd file. Anon-access = none indicates that anonymous users are not allowed to access the service. A user name and password are required. (Note: This is the problem. You must note that the format cannot be blank after the comment is removed)

 

 

Open the passwd file and set

# [Users]

# Harry = harryssecret

# Sally = sallyssecret

The format is "username = password". If you can insert a line: Admin = admin222, add a user named admin and whose password is admin222 to the system.

 

(3) run the svn Server

Run cmd

Cd d: \ Program Files \ wandisco \ Subversion

Svnserve -- daemon -- root F: \ svntest \ repository1

Start the service. -- daemon can be abbreviated to-D, and -- root can be abbreviated to-R (Note: This is a service that is temporarily opened. The window cannot be closed after the command is executed ).

You can create a batch file and place it in the Windows Startup Group to run the svn service or create a svnservice service on startup (The following describes how to create the svnservice service)

 

(4) initialize the Import
Open "my computer", right-click the directory for version control, select tortoisesvn, and then select the sub-menu "import ..."

 

Set "repository URL" to SVN: // localhost // svntest/repository1

 

Click OK and the system will prompt that the file is being imported.

 

 

Note that the svn file library and SVN service are on the same computer, so localhost is available. If other machines want to access the svn service, SVN should be used: // SVN Server IP address, for example, SVN: // 192.168.1.125 // svntest/repository1. (I haven't tried this yet. You can try it, haha !)

 

5. File Check out

Right-click the desktop and choose SVN checkout...

Set the svn directory and check out directory

After export, check the export directory!

In this way, you can modify the file content and then SVN commit. We can work on this directory.

 

6. File Export (cannot be commit, just export the file)

Right-click the desktop, select tortoisesvn, and then select the sub-menu "Export ..."

Enter the svn directory and export directory

Click OK

 

7. Install svnservice

In Windows NT (including Windows XP, Windows 2000, and Windows 2003 Server), a tool for installing services is included, which is called "service control" and also supports SC .exe.

 

Create a service:

Run cmd

Input: SC create svnservice binpath = "D: \ Program Files \ wandisco \ subversion \ svnserve.exe -- service-R F: \ svntest \ repository1 "displayname =" svnservice "depend = TCPIP start = auto

Delete service:

If there is a problem with the service installation, you may need to delete the service. To delete the previously added service, Run "SC Delete svnservice". "svnservice" is the name we used when creating the service.

 

8. SVN multi-project management

We recommend that you create a library for each project.

On the server side, create a directory to store all the warehouses. For example, F: \ svntest. Then, create a project independent under this directory.

Svnadmin create F: \ svntest \ repository1 -- FS-type fsfs

Svnadmin create F: \ svntest \ repository2 -- FS-type fsfs

Start with svnserve-d-r F: \ svntest \ repository1. In this way, the URL of your project is:
SVN: // ip (localhost can be used locally)/repository1

Start with svnserve-d-r F: \ svntest \ repository2. In this way, the URL of your project is:
SVN: // ip (localhost)/repository2

Use the repository browser to view the import results:

Right-click the Desktop

Enter URL:

 

Let's see what our warehouse looks like. Haha!

 

 

 

 

 

 

 

 

 

 

 

 

 

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.