Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

I would recommend looking at, 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 to build the project from this working copy.
  3. Set a Post-Build event (on a sucessful build) in 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 and Subversion:

Information about setting up to publish files:

Information about setting to trigger when you make a commit:

share|improve this answer

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).

share|improve this answer

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
share|improve this answer
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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