Repository administrators can enable protected branches for limiting branch manipulation, as well as 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.

Enabling a protected branch for a repository

  1. On GitHub Enterprise, navigate to the main page of the repository.

  2. Repository settings buttonIn the repository's right sidebar, click Settings.

  3. Repository options sub-menuIn the left menu, click Branches.

  4. Selecting a protected branch drop-down menuUnder Protected Branches, select the branch you want to mark protected using the drop-down menu.

  5. Protecting branch checkboxSelect Protect this branch.
  6. Click Save changes.

Enabling required status checks

  1. On GitHub Enterprise, navigate to the main page of the repository.

  2. Repository settings buttonIn the repository's right sidebar, click Settings.

  3. Repository options sub-menuIn the left menu, click Branches.

  4. Selecting a protected branch drop-down menuUnder Protected Branches, select the branch you want to mark with a required status check.

  5. Required status checks optionSelect Require status checks to pass before merging.
  6. List of available status checksFrom the list of available status checks, select the ones you want to make required.
  7. Include administrators checkboxOptionally, select Include administrators. This enforces the required status checks on the repository administrators.

  8. Click Save changes.

Tip: To successfully merge a pull request into a base branch that has required status checks enabled, the pull request's head branch must be up-to-date with the base branch.