Possible Duplicate:
Local executing hook after a git push?
git has a number of hooks that can call scripts near certain events.
Is it possible to setup a git hook in my working repository that executes something locally after I push to a remote branch? If so which hook is it?
The hooks are copied to the clone, and the post-checkout hook is fired immediately! But the template directory cannot be inside the repository you are cloning - it must already exist on the filesystem before you clone.
Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git's internal behavior and trigger customizable actions at key points in the development life cycle.
No. Hooks are per-repository and are never pushed.
The list of hooks in man githooks
is complete. There is no post-push hook. There are hooks which run in a repository after someone's pushed into it (i.e. for putting in the central repository), but nothing is triggered in the repository that you pushed from.
If there's a common task you need to do after pushing, you could make an alias which pushes then does that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With