Article version: Enterprise Server 2.13

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2019-03-27. 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.

Defining the mergeability of pull requests

Protected branches are available in public repositories with GitHub Free, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

You can require pull requests to pass a set of checks before they can be merged. For example, you can block pull requests that don't pass status checks or require that pull requests have at least one approved review before they can be merged.

About protected branches

Protected branches ensure that collaborators on your repository cannot make irrevocable changes to branches. Enabling protected branches also allows you to enable other optional checks and requirements, like required status checks and required reviews.

Configuring protected branches

If you're a repository owner or have admin permissions in a repository, you can customize branch protections in the repository and enforce certain workflows, such as requiring more than one pull request review or requiring certain status checks to pass before allowing a pull request to merge.

About required status checks

Required status checks ensure that all required CI tests are passing before collaborators can make changes to a protected branch.

Types of required status checks

You can set up required status checks to either be "loose" or "strict." The type of required status check you choose determines whether your branch is required to be up to date with the base branch before merging.

Enabling required status checks

Repository administrators can enforce required status checks before a branch is merged in a pull request or before commits on a local branch can be pushed to the protected remote branch.

About branch restrictions

Branches within repositories that belong to organizations can be configured so that only certain users or teams can push to the branch.

Enabling branch restrictions

Organization owners and people with admin permissions for organization-owned repositories can enforce branch restrictions so that only certain users or teams are able to push to a protected branch.

About required reviews for pull requests

Required reviews ensure that pull requests have at least one approved review before collaborators can make changes to a protected branch.

Enabling required reviews for pull requests

Repository administrators can enforce required reviews so that pull requests must have at least one approved review before they are merged.

About required commit signing

Required commit signing ensures that collaborators can only push verified signed commits to a protected branch.

Enabling required commit signing

Repository administrators can enforce required commit signing on a branch to block all commits that are not signed and verified.

Ask a human

Can't find what you're looking for?

Contact us