Git post-update hook for every branch

139 views Asked by At

From docs:

update

The update script is very similar to the pre-receive script, except that it’s run once for each branch the pusher is trying to update

I need multi-branch equivalent to post-receive, not pre-receive.

Thank you very much.

1

There are 1 answers

1
larsks On

The post-receive hook receives information about all branches being updated in the transaction. E.g., if I push branches "master" and "devel" to a remote repository, the post-receive hook will see something like:

<old_devel_cid> <new_devel_cid> refs/heads/devel
<old_master_cid> <new_master_cid> refs/heads/master

Given that you have a list of branches being updated, you should be able to implement whatever logic is necessary.