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 (<<<<<, =====, or >>>>>).

I already have such a script for my pre-commit, but what script applies on a rebase --continue ?

  • Batch convert text files from LF line endings to CRLF
  • Git merge or git rebase?
  • Old remote alias still visible in git logs and gitk, how to delete?
  • Setup Git-User in Aptana
  • git push to existing remote branch
  • Pulling a remote repo that has same branch name as local?
  • How do negated patterns work in .gitignore?
  • How to git stash only untracked files?
  • Can't git fetch through SSH
  • What to do when new commits happen after a git rebase?
  • Retrieving orphaned commit object after push --force
  • Add only non-whitespace changes
  • One Solution collect form web for “What git hooks apply to 'git rebase –continue'?”

    The manpage 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.

    Git Baby is a git and github fan, let's start git clone.