Setting up an SVN Server

Introduction

The simplest way to enable multiple users or computers to access a repository is to use the svnserve custom server in daemon mode (i.e running in the background).

svnserve uses the svn:// protocol and is the most efficient (and consequently the fastest) of the various network protocols supported by Subversion.

Be aware that the svn:// protocol provides no network security. This means that anyone eavesdropping on the traffic on your network can examine the contents of your commits, updates etc. While this may not be a concern for small organizations sharing a repository on a local network it would probably be unsuitable for publishing a repository within a large organization or on a public network such as the Internet.

Installation

svnserve is not included with Cornerstone but came pre-installed with your Mac.

The easiest way to obtain svnserve is by installing a Subversion binary package from here.

Starting and Stopping svnserve

To start svnserve in daemon mode, enter the following command into a Terminal window:

svnserve -d

To stop the server:

  1. Open Activity Monitor
  2. Select svnserve
  3. Select Quit from the toolbar

    Activity Monitor will ask whether svnserve should be Quit or Force Quit. You should select Quit to shut down svnserve correctly.

Assuming your repository is located at /Users/zoe/Documents/Repository and your Mac’s IP is address 192.168.1.3 then your repository can now be accessed at:

svn://192.168.1.3/Users/zoe/Documents/Repository

You can find your Mac’s IP address by opening the Network section of System Preferences and selecting the active connection from the list. The IP address will be displayed on the right.

Always including the path to the repository (/Users/zoe/Documents/Repository) in the URL when referencing files and folders gets tedious fast. You can use the --root argument to svnserve to specify the path in the file system which is served as the root:

svnserve -d --root /Users/zoe/Documents/Repository

You can now access the file at /path/to/file.txt in the repository using:

svn://192.168.1.3/path/to/file.txt

instead of

svn://192.168.1.3/Users/zoe/Documents/Repository/path/to/file.txt