Skip to content

How to Protect default branch and admin bypass it. #142759

Closed Answered by thomassiard
k-karen asked this question in Enterprise
Discussion options

You must be logged in to vote
  1. Refine Classic Branch Protection Rules
    Since you’re aiming to control permissions for Members and Admins separately, here’s how you could improve your current setup:

Member Rule:

Set up a branch protection rule for the default branch.
Under Require a pull request before merging, enable Require approvals and set it to 1.
Enable Restrict who can push to matching branches, and select only Admins (or create a custom team with Admin privileges).
Leave Allow bypassing the above settings disabled to ensure Members can't bypass these requirements.
Admin Rule:

Under Rules Sets, you can define a separate rule specifically for Admins if using GitHub’s Enterprise or Team plan.
In Require pull reque…

Replies: 2 comments 3 replies

This comment was marked as off-topic.

@DVSR1411

This comment was marked as off-topic.

This comment was marked as off-topic.

@DVSR1411

This comment was marked as off-topic.

@queenofcorgis
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants