ossys
ossys

Reputation: 4217

Git Remote Repository Fetch Hook

I have a bare remote repository and want to invoke a hook when a "git fetch" is performed against it.

I have tried several hooks that I thought might work (post-merge, which I know is for local repos but thought I'd try it anyways), I have also tried replacing some of the git-* binaries (such as git-upload-archive and git-upload-pack) with scripts that then invoke the binaries.

Any ideas on how I can trigger a script to run when a "git fetch" is performed against a remote repository? And yes, I am aware of the docs (http://www.manpagez.com/man/5/githooks/)

Upvotes: 1

Views: 383

Answers (1)

Brian Topping
Brian Topping

Reputation: 3295

I believe the answer is that you can't -- the hooks are called after write operations. See http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks for better wording on the use of the server hooks.

Upvotes: 2

Related Questions