Article version: Enterprise Server 2.14

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2019-07-12. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Using pre-receive hooks to enforce policy

Use pre-receive hooks to enforce workflow standards within your organization. Pre-receive hooks require code to pass a pre-defined set of quality checks before the push is accepted into the repository.

About pre-receive hooks

Pre-receive hooks are scripts that run on the GitHub Enterprise Server appliance that you can use to implement quality checks.

Creating a pre-receive hook environment

To execute pre-receive hooks, use either the default pre-receive environment, or create a custom environment.

Creating a pre-receive hook script

Use pre-receive hook scripts to create requirements for accepting or rejecting a push based on the contents.

Managing pre-receive hooks on the GitHub Enterprise Server appliance

Configure how people will use pre-receive hooks within their GitHub Enterprise Server appliance.

Ask a human

Can't find what you're looking for?

Contact us