What's a (common) example use case for a post-checkout hook?
It can also be used for other cases where you'd like to amend what git does by default when updating the tree. See this recent thread[1] where some users want to have mtime behavior on files that's different from git's defaults, and one way to do that is via a post-checkout hook.
1. https://public-inbox.org/git/20180413170129.15310-1-mgorny@g...
Put
git submodule sync && git submodule update --init --recursive
into `.git/hooks/post-checkout` and never again wonder why your code doesn't work after switching branches (because you forgot to update submodules).Also put it into `post-rewrite` so that the same works for `git rebase`.