I am running VisualSVN Server on my server, and I have TortoiseSVN installed on both my dev PC and my server.

I want to be able to push through updates to the website over SVN without manually checking out the latest version on htdocs.

How can I have TortoiseSVN on my server automatically checkout the latest revision of the site when I commit a new revision?


I would recommend looking at CruiseControl.net, then configuring it as follows:

  1. Create a working copy that isn't published by IIS (i.e. is only available from the server).
  2. Configure CruiseControl.net to build the project from this working copy.
  3. Set a Post-Build event (on a sucessful build) in CruiseControl.net to export to your published folder.

This has two important effects:

  1. A non building svn-revision can not be published.
  2. Your .SVN or _SVN directories will not be published. Theoreticly someone could come along and look at your source code in /.svn/text-base/your-filename.ext.svn-base.

Information about setting up CruiseControl.net and Subversion:

Information about setting up CruiseControl.net to publish files:

Information about setting CruiseControl.net to trigger when you make a commit:


If you have TortoiseSVN installed on your web server, first do a manual checkout to the pertinent path, then create a batch file (or just schedule an advanced task if on 2008) containing the following (adjust paths as necessary):

"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:"C:\Inetpub\wwwroot\mysite"

Then set the period you need (5 mins, 10 mins etc).


Use a post-commit hook script.

e.g. This post-commit.bat assumes that C:\Inetpub\Blah is a working copy and updates it every time a commit occurs:

pushd C:\Inetpub\Blah
"C:\Program Files\VisualSVN\bin\svn.exe" update
  • Publishing a working copy directly suffers from two problems - 1) it hasn't been compiled and could contain errors 2) it contains all the source code. I guess that's OK if it is just straight HTML (the asker doesn't specify) but it's more likely to be ASP.NET, so the build-and-publish approach is ultimately safer. – Tim Long Apr 23 '10 at 10:25

you will probably have to do an svn export because the hidden .snv/_svn directories contain copies of the files and if the site is not precompiled will really mess up the aspnet_compiler. svn export does not create the hidden directoies. If you want to script this you should use something like SlikSvn which gives you command line access to your Subversion repository. Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.