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.

About 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.

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.

By default, any pull request can be merged at any time, unless the head branch is in conflict with the base branch. You can choose to enforce restrictions on how a pull request is merged into your repository.

Repository owners and people with admin permissions for a repository can enforce certain workflows or requirements, before a collaborator can merge a branch in your repository by configuring protected branch settings. For more information, see "Configuring protected branches."

Branch protection settings

When you create a protected branch rule in a repository, collaborators cannot force push to the protected branch or delete the branch by default. You can enable other branch protection settings, so that collaborators:

If your repository is owned by an organization, you can restrict users or teams from pushing to a protected branch. For more information, see "About branch restrictions."

Further reading

Ask a human

Can't find what you're looking for?

Contact us