Daily Archives: January 11, 2010


SVN windows post-commit update hook 5

The environment is Windows XP running apache2 using TortoiseSVN. This is a development server that also has a copy of the repository trunk checked out and I want that checkout updated when somebody commits to the repository.

I spent hours on Google today trying to figure out how to get a hook script working on windows for SVN.

I found only one decent resource http://blog.pengoworks.com/index.cfm/2008/2/5/SVN-postcommit-for-Windows that didn’t work.  I kept getting the error ‘post-commit hook failed (exit code 1) with output: ‘svn is not recognized as an internal or external command, operable program or batch file.

Finally, a friend helped me out by looking up their configuration, which was a similar setup, and pointed me in the right direction. In the post-commit.bat file you create, the only thing in the file should be this windows command:

“pathToYourSVN.exe” update –username yourSVNUserName –password yourSVNPassword pathToYourCodeCheckout

It’s a very different solution and very simple as well.  Hope this helps!