Subversion Hooks on Windows
November 19, 2008
We've recently upgraded our internal development server to Windows 2003. I've set up subversion server along with IIS, ColdFusion and SQL Server on it. I wanted to set up subversion so that when a developer commits a file, it will be automatically copied into the IIS webroot so that the local development server always has the latest version running on it (for client previews etc).
This can be done by using the post-commit hook. On Windows you will need to rename the post-commit.tmpl file to post-commit.bat which is in the hooks directory in your repository.
Here is my post-commit.bat file:
REM ----------------------------------------------------------------- REM - can use svn update or commit (which will create the working copy as well) REM - or export (which is slow as all files are exported) REM ----------------------------------------------------------------- "C:\svnserverpath\bin\svn.exe" update http://192.168.1.3:8080/svn/aliaspooryorik/trunk/ D:\webroot\aliaspooryorik --username myuser --password mypassword
To get this working you will need to checkout the repository to D:\webroot\aliaspooryorik first and also set up a user (only needs to be read only) to login as.
Hope this saves some head scratching!
- Posted in:
- Subversion
- Resources
2 comments
Leave a comment
If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

see for the basic idea - tinyurl.com/5qkffq
Comment by Mike – November 19, 2008
Thanks for the comment and link. I'd missed that Jedi Master post!
That is definately worth exploring as it opens up a lot of possibilities. Equally it also introduces a lot of opportunity for things to break as the process would be subversion -> batch file -> CUrl -> ColdFusion -> cfexecute back to subversion!
Comment by John Whish – November 20, 2008