Bob Ippolito (@etrepum) on Haskell, Python, Erlang, JavaScript, etc.

svnsync: mirror your svn repository


Since the svnsync tool in Subversion 1.4 still lacks documentation, here's a quick example to get you started with it:

$ svnadmin create
$ echo '#!/bin/sh' >
$ chmod +x
$ svnsync init file://$PWD/
$ svnsync sync file://$PWD/

The example performs the following tasks:

  • Creates a new local repository named
  • Adds a trivial pre-revprop-change hook to the repository (required for svnsync)
  • Initializes the repository to be a mirror of
  • Synchronizes the repository with its initialized source

Note that this is point-in-time synchronization. To keep an up to date mirror you'll have to run svnsync sync on a regular basis (e.g. by cron job or post-commit hook).

If you're looking for an especially easy to install set of svn binaries for Mac OS X, I recommend Martin Ott's (of SubEthaEdit fame) build. I've been using it on all of my Macs for quite some time with no issues. Much less hassle than building it myself or using MacPorts (previously known as DarwinPorts).

blog comments powered by Disqus