prereceive
Prereceive, often written prereceive (or pre-receive), refers to a server-side hook in Git that runs when a client pushes changes to a remote repository. It is invoked on the receiving end before any refs are updated, allowing the server to enforce policies or reject a push before data is written. The hook is typically implemented as a script named pre-receive (or prereceive) located in the repository’s hooks directory on the server.
During execution, the prereceive script reads lines from standard input, each containing old-value new-value ref-name. These
Prereceive is complemented by other server-side hooks such as update (which runs once per ref) and post-receive
Common uses include enforcing commit message formats, blocking certain file types or large binaries, preventing force