Running A Personal SVN Server on Mac Snow Leopard

I love version control. I use it more than is probably appropriate to be honest. For personal projects that don't warrent their own page on github or google projects I like to use a quick and simple svn repo right on my laptop. I have Apple's Time Machine running on there and full weekly snapshots saved to an external hard drive, so I'm not too concerned about the repo itself getting hosed.

I do however want it to be easy to make frequent commits to files I'm working on. And I specifically don't want to run svn with apache -- that is simply overkill for my personal usage. Finding decent instructions on how to set that up on Snow Leopard is difficult, so here's how I did it:

1. If you haven't already done so, download the installer for the excellent My Subversion-1.5.5 Package. It's simply a double click job and you then have an svn server and client all ready to go.

2. Create a folder to hold your repo. Adjust the filepaths to match your own system, obviously:

mkdir /Users/michael/svn

3. Start the svn server, pointing it at the repository directory you just created:

svnserve -d -r /Users/michael/svn

4. Create a new repository:

svnadmin create /Users/michael/svn/projects

5. Set up users for that new repository. This may be the most complicated step, but even this is very straight forward if you can edit an ini file:

bbedit /Users/michael/svn/projects/conf/svnserve.conf

It's just an ini type of file and has loads of useful comments (so read them). You'll want it to say this:

[general]
anon-access = read
auth-access = write
password-db = passwd
realm = projects

That means anonymous users can only read, while authenticated users can read and write. Also the password file is going to be in conf/passwd. So let's edit that now:

bbedit /Users/michael/svn/projects/conf/passwd

Again, a very simple ini type of file. Add yourself to it and save.

[users]
michael = secretpassword

6. Checkout your repository:

cd ~/Workarea
svn co svn://localhost/projects

7. Make changes, commit:

cd ~/Workarea/projects
bbedit README.txt
svn add README.txt
svn commit README.txt -m 'Initial commit.'

8. Finally, you can always stop the svn server, if you want to save a little battery juice:

killall svnserve

permalink | Tags: mac, svn.

contact

tags

archive

more blogs