Git Hooks Post-checkout


Example

This hook works similarly to the post-commit hook, but it's called whenever you successfully check out a reference with git checkout. This could be a useful tool for clearing out your working directory of auto-generated files that would otherwise cause confusion.

This hook accepts three parameters:

  1. the ref of the previous HEAD,
  2. the ref of the new HEAD, and
  3. a flag indicating if it was a branch checkout or a file checkout (1 or 0, respectively).

Its exit status has no affect on the git checkout command.