What git hooks apply to 'git rebase –continue'?
I’m trying to build a set of git hook scripts for my organization, and one I would like to use (for multiple project just for myself) would be to check upon a
git rebase --continue that I don’t have any conflicts markers leftover in my code (
I already have such a script for my pre-commit, but what script applies on a
rebase --continue ?
One Solution collect form web for “What git hooks apply to 'git rebase –continue'?”
githooks has a list of the available git hooks.
There is no hook for
git rebase --continue (the list is exhaustive).
There is a hook “post-rewrite”, which “is invoked by commands that rewrite commits”, such as
git rebase. However, it only runs once the command is done (i.e. when the rebase is finished).
It will give you the list of new commits created by the rewrite, so you could check if the commits introduce any conflicts markers and complain, but at that point it is too late to abort the rebase. You can still revert the rebase using the reflog, of course.
All in all, it is probably easier to write some wrapper for
git rebase, or a separate checking tool to invoke manually. At any rate, you should (IMHO) always review the changes you made before invoking
git rebase --continue. If you stick to doing that, you will not accidentally have conflict markers checked in.