branch protection rule

A setting on a hosting service that stops changes reaching a branch, usually main, unless conditions such as an approved review and passing checks are met.

In more detail

It can block direct pushes, force pushes and deletion, so every change arrives through a reviewed pull request. Hosting services such as GitHub and GitLab provide it; plain Git has no such rules.

Example

In Terraform: For Terraform it is how a team makes sure nobody can change or destroy production alone: applies run only from the protected branch, after approval.

Related terms

Taught in

References

Certification courses