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.

Configuring protected branches

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.

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.

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

  2. Under your repository name, click Settings.

    Repository settings button

  3. In the left menu, click Branches.

    Repository options sub-menu

  4. Under "Protected branches", select the branch you want to mark protected using the drop-down menu.

    Selecting a protected branch drop-down menu

  5. Select Protect this branch.

    Protecting branch checkbox

  6. Optionally, you can configure specific branch protections.

  7. To confirm the protected branch settings, click Save changes.

Further reading

Ask a human

Can't find what you're looking for?

Contact us