Setting Up a Repository

Harry · 13 Sep 2026 · 1 views

Create the Repository

sudo mkdir -p /srv/svn
sudo svnadmin create /srv/svn/project

The svnadmin create command builds the repository directory with all metadata, hooks and configuration inside it.

Standard Layout

Adopt the trunk/branches/tags convention from day one:

project/
  trunk/       # main line of development
  branches/    # feature and release branches
  tags/        # snapshots

Serve It

The simplest server is svnserve on the default port 3690:

svnserve -d -r /srv/svn
# checkout from another machine:
svn checkout svn://server/project/trunk project-checkout

Access Control

The conf/svnserve.conf file sets the authz rules; conf/passwd holds users:

[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz

Backup the Repository

svnadmin dump gives a portable full backup:

svnadmin dump /srv/svn/project > project.dump

Restore with svnadmin load into a fresh repository.

Key Points

  • svnadmin create builds the repository skeleton.
  • Use trunk/branches/tags from the start.
  • svnserve shares repositories over the network.
  • authz files control who reads and writes what.
Share this post:

Comments (0)

Please login or register to comment.