TxH TxH - 11 months ago 65
Git Question

Git post-rewrite not executed

I have an executable

file, which for testing purposes
has the following lines in it:


echo "Notice: post-rewrite hook is running"

My understanding is that the
hook runs after operations that rewrite commit history, such as
git commit --amend

Indeed, running
git commit --ammend
will print the message to
after commiting. However, when I do
git rebase master
from a branch that is behind
, or
git pull --rebase
, nothing is printed to

Am I missing something?

Answer Source

when I do git rebase master for a branch that is behind master; or git pull --rebase

You are not rewriting any commits; you are fast-forwarding; so basically your branch just points to another commit. None of the commits are rewritten.