Before enabling required reviews on a branch, you must first set the branch up as a protected branch. For more information, see "Configuring protected branches."
You can automatically enforce protected branch settings for some or all branches in your repository. For more information, see "Configuring protected branches."
- On GitHub Enterprise Server, navigate to the main page of the repository.
- Under your repository name, click Settings.
- In the left menu, click Branches.
- Next to "Branch protection rules", click Add rule.
- Under "Branch name pattern", type the branch name or pattern you want to protect.
- Select Require pull request reviews before merging.
- In the Required approving reviews drop-down menu, select the number of approving reviews you'd like to require on the branch.
- Optionally, select Dismiss stale pull request approvals when new commits are pushed. This dismisses a pull request approval review when a code-modifying commit is pushed to the branch.
- Optionally, select Require review from Code Owners to require review from a code owner when the pull request affects code that has a designated owner. For more information, see "About code owners."
- Optionally, if the repository is part of an organization, select Restrict who can dismiss pull request reviews to search for and select the people or teams who can dismiss pull request reviews. For more information, see "Dismissing a pull request review." This option is not available for personal repositories.
- Optionally, select Include administrators. This enforces all configured restrictions for repository administrators.
- Click Create.