Article version: Enterprise Server 2.15

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2019-10-16. 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 branch restrictions

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

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. The ability to restrict branches is a type of branch protection that's available for public and private repositories owned by organizations in GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

When you enable branch restrictions, only people or teams that have been given permission can push to the protected branch. You can view and edit the users or teams with push access to a protected branch in the protected branch's settings.

Organization owners and people with admin permissions for a repository are always able to push to a protected branch.

Restricted branch permissions.

Note: If the "Include administrators" is checked and you've enabled required status checks on the branch and they fail, any attempt to push changes to the base branch will also fail, regardless of a user or team's permission status.

Further reading

Ask a human

Can't find what you're looking for?

Contact us