Hi Frank,
On 2015-08-13 14:22,
frank....@gmail.com wrote:
> I have a repository (R1) where i do all the modifications before
> committing
> and manually pushing it to the server (git push origin test)
> I have a second one, (R2) which only gets automatically the last
> modifications: git pull origin test
> (Y:\Myprod\diff-gitstore\myprogs)
>
> The automatic pull is done through the post-update hook which resides
> under
> the R1 repository:
>
> Y:\Myprod\gitstore\myprogs\.git\hooks\post-update
> here is the content:
> ------------------------------------------------
> #!/bin/sh
>
> cd /Y/Myprod/diff-gitstore/myprogs
>
> echo "git pull from server ... test branch"
>
> unset GIT_DIR
>
> git pull origin test
> -------------------------------------------------
> I expect that, after pushing manually the modifications, the script
> automatically runs and pull modifications to R2.
> It doesn't.
From
https://www.kernel.org/pub/software/scm/git/docs/githooks.html:
> post-update
>
> This hook is invoked by git-receive-pack on the remote repository,
> which happens when a git push is done on a local repository. It
> executes on the remote repository once after all the refs have been
> updated.
In other words, the `post-update` hook will not be called on the
*client* but on the *server* side (but maybe not in Git Blit, either,
because it is a pure Java solution. At least from glancing at
http://gitblit.com/setup_hooks.html it does not seem as if you could use
shell scripts as hooks (and you would still have the problem that you
want to run a program on the *client* side, which the *server*'s hook
cannot trigger).
Ciao,
Johannes