4

I have a subversion installation with one repository per project and would like to add a few commit hooks that should apply for all the repositories. Is there any way to add a hook for all repositories? Especially in such a way that when I add a new repository these hooks also apply automatically? I can only find ways to do this on a per-repository basis.

Youri
  • 73
  • 1
  • 3

1 Answers1

5

Hooks can only be set up per repository. I usually have a folder where hooks are stored and use a batch file with a loop to copy them to the repositories.

To do this easily create a folder templates in the SvnParentPath (the root folder of your repositories) where you put your hooks

Then create a batch file containing the following code (change the %% to % to run this directly on the command line.):

    FOR /D %%I in (*) DO copy .\templates\*.* %%I\hooks\ /Y
Filip De Vos
  • 11,568
  • 1
  • 48
  • 60