Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:
>
> Is there such a thing as a pre-push hook? It would certainly have
> helped me, if that checked for a non-clean tree: I mostly don't mess
> around in the git-ssh tree other than to commit. Development happens
> in the read-only git:// tree.
This just came up on the git list[1]. One of the suggestions was adding this
to your .git/config:
[alias]
send = !path/to/my-hook && git push "$@"
then use 'git send' instead of 'git push' within that repository, where the
push will refuse to run if my-hook rejects it. In your case, my-hook could
then check for a clean tree.
[1] http://thread.gmane.org/gmane.comp.version-control.git/92900/focus=92919
--
Eric Blake