I've got an SVN repository that lives on a Windows network drive (and accessed through a file url). A number of my coworkers can't and won't use SVN, so I need to maintain a read-only mirror of everything in the repository in another directory.

I don't see any easy way to do it. I can't make it a working copy, because that chews up too much network space. svn export won't remove files which are deleted from the repository. I was trying to create a hook script to copy files over when they're checked in, but I can't guarantee the path to the SVN executable will be the same for every client.

I was going to simply have a script which I manually run which compares each file in the repository with the file on the network and either deletes or copies it if there's a mismatch, but I can't seem to get the size of the file from the repository, which means I would have to rely solely on the reported change date of the file--which I'm reluctant to do.

What's the best way of getting this set up?

  • ... Why would making it a working copy chew up too much network drive space? Jun 6, 2009 at 0:04
  • Working copies store a minimum of two copies of every file in the repository, so they can compare differences locally.
    – Chris B.
    Jun 6, 2009 at 0:14
  • Some here may disagree but if you want hassle free SVN you might want to check out: cvsdude.com
    – KPWINC
    Jun 6, 2009 at 16:54

5 Answers 5


They won't use SVN? Honestly, I'd do my best to shove it down their throats (any end user can use TortoiseSVN with a minimal of re-training) if at all possible. There's no reason you should have to hack around their laziness.

As far as I see it, there are at least two ways of hacking it --

  • Create separate working copies and hand-manage SVN for each

I actually have the same problem at my place of work, and my boss told me that we can't force them to use it. Instead, we create a network share for each developer/group which needs access to the code, then manually svn up/svn commit for them upon request.

  • Have one "Master" working copy and hand out SMB/FTP/NFS access to it

We have a terrible setup with another group -- they didn't want to use SVN, so we just gave them raw Samba access to the production machine to tinker with the files. Then, every night a cron job goes through and adds all the new files and commits it to the repo. Since there's only one working copy there aren't ever any conflicts. Honestly it's serves little purpose except to make me sleep a little sounder at night.

They're both absolutely stupid ways of doing it -- the first requires hand conflict resolution (by you, or a member of your team) and the other has practically no advantage over the disk backups. IMHO the only real solution is to teach your end-users not only how to use SVN, but why they should be using it. That way they can be responsible for their own work, leaving you to deal with the real problems.


Make a ROBOCOPY /MIR from an existing working copy?


Perhaps you could use webdav for this? More info here: webdav autoversioning Be sure to read through the warnings and such.

(But I agree with the "force them to use it anyway" answer.)


Try using SVN::Notify::Mirror


It's a perl module, but you hook into it via the standard SVN hook system (the documentation has examples).

This will keep a checked-out copy of the repository or portion thereof locally, but can then push that to another system using rsync. So long as you get your permissions straight, this will be your read-only up-to-date copy for people to refer to.


I have made some tests with VisualSVN Server and tortoise

If I put this command in the Post-Commit hook, any change I do are sent to the c:\data\folder_to_share_readonly folder.

"svn_executable_path\svn" update c:\data\folder_to_share_readonly --quiet --non-interactive --username myUser --password myPwd

  • I forgot to mention that I did a manual checkout prior to that operation.
    – Hapkido
    Jun 6, 2009 at 10:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .