How to require a review before merging in GitHub
This guide shows how to add a branch protection rule, require approving reviews, and confirm that an unreviewed pull request is blocked.
Independent guide
Before you start
- A GitHub account with admin access to the repository
- A default branch that is safe to protect
Interactive guide
What you will do
This guide shows how to add a branch protection rule, require approving reviews, and confirm that an unreviewed pull request is blocked. When you finish, the change is saved in GitHub and you can confirm it without leaving the screen you ended on.
Steps at a glance
- Open repository settings
- Select Branches
- Add a branch protection rule
- Enter the branch name pattern
- Require a pull request before merging
- Set the number of approving reviews
- Save the rule
- Open a test pull request to confirm it is blocked
Something changed?
Software changes quickly. Tell us if a step is inaccurate or no longer matches the product.
Report an outdated stepWant guides like this for your product?
Alex Hints creates interactive guide libraries for onboarding, support, releases, and training.