1. download the latest version of SVN server such as svn-1.4.6-setup.exe
2. download the latest version of SVN client such as TortoiseSVN-1.4.8.12137-win32-svn-1.4.6.msi
3. Create an empty folder on the disk, such as D:/Repository.
4. Create multiple empty subfolders in the repository folder if group1, group2, group3. .. for future grouping.
5,
I. Preparations
1. Obtain the Subversion server program
Download the latest server installer from the official website (http://subversion.tigris.org. Currently the latest version is 1.5, specific in: http://subversion.tigris.org/servlets/ProjectDocumentList? Folderid = 8100 & expandfolder = 8100 & folderid = 91
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.
Ii. Install the server and client
Install the subversion (SVN) server and client. The downloaded Server is a zip package, which can be decompressed directly. For example, I can decompress the package to E:/subversion. The Client installation file is an EXE executable file. You can directly run the file and follow the prompts to install it. After the Client installation is complete, the system prompts you to restart.
3. Create a version Library (repository)
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. First, create an empty D:/repository 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 create d:/Repository/group1
This command creates a version library group1 Group1 under E:/SVN. Some folders and files are automatically generated.
We can also use tortoisesvn to perform this step graphically:
First, create an empty Directory D:/Repository/group1. Be sure to leave it empty. In the group1 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:
D:/> svnserve-D-r d:/Repository
5. Configure users and permissions
1. Open the Directory D:/Repository/group1/conf in a text editor and modify svnserve. conf:
1) Modify server. conf
Set:
# Password-DB = passwd
Changed:
Password-DB = passwd
Set:
# Anon-access = read
Changed:
Anon-access = none
2) modify the passwd file
Remove the # annotator. Note that there is no space before it.
Set:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
Changed:
[Users]
Lisi = Lisi (this is the username and password set by the Administrator)
Zhangsan = zhangsan (this is the username and password set by the Administrator)
3) modify the authz File
Set:
[Groups]
# Harry_and_sally = Harry, Sally
# [/Foo/bar]
# Harry = RW
# * =
# [Repository:/Baz/fuz]
# @ Harry_and_sally = RW
# * = R
Changed:
[/]
Lisi = RW (set the permission of the Lisi user to be readable and writable to the group1 database in this group)
Zhangsan = RW (set the permissions of the zhangsan user to be readable and writable to the group1 database in this group)
* =
2. Open the D:/Repository/conf directory in the text editor and modify svnserve. conf:
Set:
# Password-DB = passwd
Changed:
Password-DB = passwd
Set:
# Anon-access = read
Changed:
Anon-access = none
Set:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
Changed:
[Users]
Admin = Admin
Lisi = Lisi (this is the username and password set in group1)
Zhangsan = zhangsan (this is the username and password set in group1)
1) Modify server. conf
Set:
# Password-DB = passwd
Changed:
Password-DB = passwd
Set:
# Anon-access = read
Changed:
Anon-access = none
2) modify the passwd file
Remove the # annotator. Note that there is no space before it.
Set:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
Changed:
[Users]
Admin = Admin
Lisi = Lisi (this is the username and password set in group1)
Zhangsan = zhangsan (this is the username and password set in group1)
3) modify the authz File
Set:
[Groups]
# Harry_and_sally = Harry, Sally
# [/Foo/bar]
# Harry = RW
# * =
# [Repository:/Baz/fuz]
# @ Harry_and_sally = RW
# * = R
Changed:
[Groups]
Group_admin = Admin
Group1 = Lisi, zhangsan
[/]
@ Group_admin = RW
* =
[/Group1]
@ Group1 = RW
* =
3. The first and second steps must be performed for the two or more groups.
Vi. initialize Import
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 guestbook folder under D:/wwwroot, which stores the message book program I wrote. In this folder, right-click "-> tortoisesvn-> Import..." And enter "SVN: // localhost/group1" in "URL of repository" in the pop-up dialog box ". In "Import message", enter "import entire message book" as the comment.
After clicking OK, enter the account. Enter Lisi in both the user name and password. After completion, all content in the guestbook is imported to SVN: // localhost/group1/guestbook.
We can see that there is no change in D:/Repository/group1, and even a guestbook folder is not created. The only change is that the capacity of D:/Repository/group1 is increased. In fact, the content in the source guestbook has already been imported into the repos1 version library, and the source guestbook 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 133.96.121.22, the content entered in the URL section is "SVN: // 133.96.121.22/group1 ".
VII. Basic operation procedure
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 and choose SVN checkout ". In "URL of repository", enter "SVN: // localhost/SVN/repos1/Guestbook" to get a copy of the content in the guestbook.
2. Check in/commit)
Make changes in the work copy and submit:
In the copy of the guestbook job, open a file 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.