Enabling branch restrictions
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.
Organization owners and people with admin permissions for organization-owned repositories can enforce branch restrictions so that only certain users or teams are able to push to a protected branch.
-
On GitHub Enterprise, navigate to the main page of the repository.
-
Under your repository name, click Settings.
-
In the left menu, click Branches.
-
Under Protected Branches, select the branch you want to restrict using the drop-down menu.
-
Select Restrict who can push to this branch.
-
Search for and select the people or teams who will have permission to push to the protected branch.
-
Click Save changes.