Easy Tutorial
❮ Svn Intro Svn Show History ❯

SVN Create Repository


Using the svn command to create a repository:

[tutorialpro@centos6 ~]# svnadmin create /opt/svn/tutorialpro01
[tutorialpro@centos6 ~]# ll /opt/svn/tutorialpro01/
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/tutorialpro01/conf directory and modify the default configuration files, including svnserve.conf, passwd, and authz to configure users and permissions.

  1. SVN Service Configuration File svnserve.conf

The SVN service configuration file is located in the repository directory at conf/svnserve.conf. This file consists of a single [general] configuration section.

[general]
anon-access = none
auth-access = write
password-db = /home/svn/passwd
authz-db = /home/svn/authz
realm = tiku
  1. Username and Password File passwd

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

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

<username> = <password>
[users]
admin = admin
thinker = 123456
  1. Permissions Configuration File

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

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

<group> = &lt;user list>

The section name format for repository path permissions is as follows:

[&lt;repository name>:<path>]
[groups]
g_admin = admin,thinker

[admintools:/]
@g_admin = rw
* =

[test:/home/thinker]
thinker = rw
* = r

This example uses svnserve -d -r /opt/svn to start SVN in multi-repository mode, so the URL is svn://192.168.0.1/tutorialpro01.

❮ Svn Intro Svn Show History ❯