Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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've set up a repository to configure my websites, the repository is /subversion/web and at the moment I have just one website controlled in /subversion/web/mywebsite

I've set up a post-commit hook script that exports the site into a web directory on the server for testing before I publish it all separately and it works fine.

What I'd like to do is set the script so that I can control a second website in the same repository but only have 'mywebsite' export when I check in a file related to that project.

I've set it up this way because I access the repository from a number of computers via http, it makes it easier to create new projects without having to create a whole new repository and configure apache to point at it and all the rest of it.

latest svn running on latest ubuntu with latest apache2

share|improve this question
up vote 1 down vote accepted

You can do this using the "svnlook" command.

Here's an example post-commit hook:

/usr/bin/svnlook dirs-changed -r "$REV" "$REPOS" | egrep -q '^mywebsite'
if [ $? -eq 0 ] ; then
    # publish site code

You may need to run svnlook manually a few times to become familiar with the output and see how to set the match pattern for the grep.

share|improve this answer
brilliant, thank you – MalphasWats Feb 13 '10 at 9:53

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.