Interview Prep/Git & GitHub/Hooks, submodules, LFS and signing

What do `pre-receive` and `update` hooks do and how do they differ?

AdvancedConceptHooks, submodules, LFS and signing
Answer

Both run on the server during push. pre-receive runs once for the whole push and gets all ref updates on stdin (old new ref); rejecting stops everything. update runs once per ref and receives the ref and SHAs as arguments, so it can reject branches individually. Hosted GitHub does not allow custom hooks except on GitHub Enterprise Server, which is why rulesets are used.

All Git & GitHub questions Roadmap: Git & GitHub

More on Hooks, submodules, LFS and signing