Setting up Subversion on Mac OS X 10.5

I recently began working exclusively on an iMac so I decided to setup a subversion server locally and as my new machine would simply replace my local development machine, which is a Fedora Core 6 pc.

You’ll need to setup at least one repository. I’m going to need multiple repositories that I can use for different clients so I have a bit of extra admin work ahead of me. You can setup as many repositories as you need, but no matter what you’ll need at least one. Here create the folders…

# mkdir /svn
# mkdir /svn/repos

Then we need to tell subversion to make our first repository.

# svnadmin create /svn/repos/myproject

First, I need to setup a config file for svnserve.

# vi /svn/repos/conf/svnserve.conf

Then, look for variations of the following code and edit it as necessary. By default any anonymous user can access the code so to disable that you must include anon-access = none, just commenting the value out will not prevent anonymous access.

anon-access = none
password-db = passwdfile
realm = My SVN Repository
auth-access = write

The password-db is just a path to a file containing usernames and passwords. You’ll create this file especially for SVN. I create each file inside of the repository conf directory. So, save your changes and then we’ll create said user file.

# vi passwdfile

Enter in something like:

[users]
username = password

Anyway, you’ll need to start the svn server.

# svnserve -d --listen-port=3690

One side note – svnserve just runs and doesn’t have a way to stop besides killing the process. If you make changes to the svnserve.conf or user file you’ll need to restart svnserve.

# killall svnserve

Then, go ahead and test (best to do so on a different machine).

# svn co --username=myusername svn://mydomain/svn/repos/myproject

The system should then ask you for your password. Go ahead and run some tests.

Possibly related posts:

  1. CVS to Subversion Transfer
  2. Installing Subversion on Fedora Core
  3. Subversion Post-Commit Email

2 Comments »

  1. Thanks for the tutorial. Does SVN start automatically on reboot? If not, how can I accomplish that?

    Thanks!

    Comment by MikeBronner — August 6, 2010 @ 7:19 am

  2. It will not start automatically on boot and I’m sure you can find out how to do that with a search. In the past two years I’ve really been using git exclusively so it’s been a while since I’ve played with SVN on mac.

    Comment by Michael Botsko — August 6, 2010 @ 7:23 am

RSS feed for comments on this post.

Leave a comment