Protected branches block several features of Git on a branch that a repository administrator chooses to protect. A protected branch:
- Can't be force pushed
- Can't be deleted
- Can't have changes merged into it until required status checks pass
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."
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.