Comment on Discussion of the Benefits and Drawbacks of the Git Pre-Commit HookparentComments−jakub_g10moYou can check inside the hook if you're in the middle of the rebase, and exit the hook early.This is what we have in our hooks: if [ -d "$(git rev-parse --git-path rebase-merge)" ] || \ [ -d "$(git rev-parse --git-path rebase-apply)" ] || \ [ -f "$(git rev-parse --git-path MERGE_HEAD)" ]; then exit 0 fi−rmwaite10moThanks for this, I can’t believe this never occurred to me to try to do.
Comments
You can check inside the hook if you're in the middle of the rebase, and exit the hook early.
This is what we have in our hooks:
Thanks for this, I can’t believe this never occurred to me to try to do.