Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SVN create repository

SVN create repository


Use the svn command to create the repository:



[runoob@centos6 ~]# svnadmin create /opt/svn/runoob01

[runoob@centos6 ~]# ll /opt/svn/runoob01/

total 24

drwxr-xr-x 2 root root 4096 2016/08/23 16:31:06 conf

drwxr-sr-x 6 root root 4096 2016/08/23 16:31:06 db

-r--r--r-- 1 root root    2 2016/08/23 16:31:06 format

drwxr-xr-x 2 root root 4096 2016/08/23 16:31:06 hooks

drwxr-xr-x 2 root root 4096 2016/08/23 16:31:06 locks

-rw-r--r-- 1 root root  229 2016/08/23 16:31:06 README.txt

Enter the /opt/svn/runoob01/conf directory and modify the default configuration files, including svnserve.conf, passwd, and authz, to configure related users and permissions.

1. SVN service configuration file svnserve.conf

The svn service configuration file is conf/svnserve.conf in the repository directory. This file consists of only one [general] configuration section.



[general]

anon-access = none

auth-access = write

password-db = /home/svn/passwd

authz-db = /home/svn/authz

realm = tiku 

2. Username and password file passwd

The username and password file is specified by the password-db configuration item in svnserve.conf, defaulting to passwd in the conf directory. This file consists of only one [users] configuration section.

The configuration line format of the [users] section is as follows:



<用户名> = <口令>



[users]

admin = admin

thinker = 123456

3. Permission configuration file

The permission configuration file is specified by the authz-db configuration item in svnserve.conf, defaulting to authz in the conf directory. This configuration file consists of one [groups] configuration section and several repository path permission sections.

The configuration line format in the [groups] section is as follows:



<用户组> = <用户列表>

The section name format of the repository path permission section is as follows:

[<版本库名>:<路径>] 



[groups]

g_admin = admin,thinker



[admintools:/]

@g_admin = rw

* =



[test:/home/thinker]

thinker = rw

* = r

This example uses svnserve -d -r /opt/svn Start SVN with the multi-repository svnserve method, so the URL:svn://192.168.0.1/runoob01.