TxH
TxH

Reputation: 448

Executing a git-hook after pull --rebase

I'd like to have a hook run after doing git pull --rebase in order to check if a certain file was changed. Something along the lines of this hook.

I initially thought of using the post-rewrite hook, however that only works when commits are being rewritten, and won't run when the pull operation simply fast-forwards the branch, which is very often.

Any ideas will be appreciated.

Upvotes: 7

Views: 1273

Answers (1)

larsks
larsks

Reputation: 311387

I ran strace git pull --rebase on a local repository, which performed a fast-forward update...

First, rewinding head to replay your work on top of it...
Fast-forwarded master to b0a60c3302973ca1878d149d61f2f612c8f27fac.

...and it looks as if git calls the post-checkout hook in this case:

Upvotes: 5

Related Questions