👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.
Article version: Enterprise Server 2.20

About protected branches and required status checks

Protected branches ensure that collaborators on a repository cannot make irrevocable changes to branches. Required status checks ensure that all required CI tests are passing before collaborators can make changes to a protected branch. Branches within repositories that belong to organizations can be configured so that only certain users, teams, or apps can push to the branch.

Protected branches block several features of Git on a branch that a repository administrator chooses to protect. A protected branch:

Anyone with admin permissions for a repository are always able to push to a protected branch. If you enable branch restrictions, only users, teams, or apps that have been given permission can push to a protected branch. For more information, see "Configuring protected branches and required status checks."

Restricted branch permissions.

Note: If "Include administrators" is selected, you've enabled required status checks on the branch, and status checks fail, any attempt to push changes to the protected branch will also fail, even for people and apps with admin permissions.

Ask a human

Can't find what you're looking for?

Contact us