The Pre-receive (push) Hook validates all incoming commits as they first appear in a repository. If changes are validated once, they are not checked by the pre-receive hook again.

A Merge Check validates all commits included in a pull request (YACC does this even if they were checked already). This allows postponing validation until the pull request merge, rather than at the time the changes are pushed. If you have not enabled Pre-receive (push) hook, incoming changes are not validated during a push.

Pull Request merge can create new commits with new hashes which have not been validated yet, so a Pre-receive (push) hook should step in here and validate them on merge. For example:

  • merge commit for the pull request. This can be excluded by enabling the Exclude Merge Commits option.

  • merge strategies like history-modifying commits created with rebase or squash merge strategies. Recommendation: avoid using these merge strategies. Contact Support if you encounter any issues.

  • commits introduced by fork / sync / resolve-conflicts / upmerge workflows

You can use Pre-receive (push) Hook and Merge Check independently with separate settings, or you can enable them both to combine validation of some rules as they are committed and postpone some checks until a Pull Request merge.