Can I create a repository on a network directory?

Do not create a Berkeley DB repository on a network share!

It cannot exist on a remote filesystem such as NFS, AFS, or Windows SMB. Berkeley DB requires that the underlying filesystem implement strict POSIX locking semantics, and more importantly, the ability to map files directly into process memory. Almost no network filesystems provide these features. If you attempt to use Berkeley DB on a network share, the results are unpredictable. You may see mysterious errors right away, or it may be months before you discover that your repository database is subtly corrupted.

If you need multiple computers to access the repository, you can create an FSFS repository on the network share, not a Berkeley DB repository. In practice this is not recommended for three very good reasons:

  1. You are giving direct write access to all users, so they could accidentally
    delete or corrupt the repository file system.
  2. Not all network file sharing protocols support the locking that Subversion requires.
    One day you will find your repository has been subtly corrupted.
  3. You have to set the access permissions in just the right way.
    SAMBA is particularly difficult in this respect.

A better solution by far is to set up a real server process (such as Apache or svnserve), store the repository on a local filesystem which the server can access, and make the repository server available over a network. It is easier than you might think. Chapter 6, Server Configuration in the Subversion Book covers this process in detail.

To access an FSFS repository on a network share you need to do one of the following:

  1. Use drive mapping using the syntax below:
    Map //server/shared to S:
    file:///S:/repos (3 leading slashes before drive letter)
  2. Specify a UNC path directly using the syntax below:
    Subversion >= 1.2
    file://server/shared/repos (2 leading slashes)
    Subversion < 1.2 (strange syntax, we know)
    file://///server/shared/repos (5 leading slashes)
    file:///\server/shared/repos (3 slashes + backslash)