According to the manual, the post-checkout
hook is run after a git checkout
(just as expected) but also after a git clone
(unless you pass --no-checkout
).
Very well, now, considering the following:
- you don't have a local repository before a
git clone
- hooks are not synced between remotes
hooks stored in a custom template directory used with(that is actually not true as stated by Jefromi in his answer, but the hook is still not executed)--template
are copied non-executable and therefore not executed aftergit clone
It seems impossible that a post-checkout
hook ever gets executed after a git clone
. Still, the githooks
man page at http://www.kernel.org/pub/software/scm/git/docs/githooks.html explicitely states a way to avoid it being executed, and also parameters passed in case it is executed, which would indicate it is possible to execute a custom hook after a git-clone
.
So, how is it possible? I am obviously missing something here.
Turns out