Repository administrators for organizations can enforce branch restrictions so that only certain users or teams are able to push to a protected branch.

Enabling branch restrictions

  1. On GitHub Enterprise, navigate to the main page of the repository.

  2. Repository settings buttonUnder your repository name, click Settings.

  3. Repository options sub-menuIn the left menu, click Branches.

  4. Selecting a protected branch drop-down menuUnder Protected Branches, select the branch you want to restrict using the drop-down menu.

  5. Branch restriction checkboxSelect Restrict who can push to this branch.
  6. Branch restriction searchSearch for and select the people or teams who will have permission to push to the protected branch.
  7. Click Save changes.

Further reading