Pull Requests (PRs) are a key part of the GitHub collaboration workflow, allowing developers to propose changes, request feedback, and merge updates into a shared codebase. As a reviewer, knowing how to approve a PR on GitHub ensures a smooth and collaborative development process.
In this guide, we’ll walk through how to review and approve a pull request on GitHub, both via the web interface and GitHub CLI.
🔍 What Does It Mean to Approve a PR?
When you approve a pull request:
- You’re signaling that you’ve reviewed the changes
- You’re satisfied with the code quality, logic, and style
- You support merging the PR into the target branch
An approval may be required for the PR to be merged, depending on the repository’s branch protection rules.
✅ How to Approve a Pull Request via GitHub Web UI
Step 1: Navigate to the Pull Request
- Go to the repository on GitHub.
- Click the “Pull requests” tab.
- Select the PR you want to review.
Step 2: Review the Code
- Use the “Files changed” tab to examine the code line by line.
- Add inline comments if needed to suggest improvements or ask questions.
Step 3: Submit Your Review
- Click the “Review changes” button (top right of the “Files changed” tab).
- Choose one of the three options:
- Comment – Leave general feedback without approving or rejecting
- Approve – Accept the changes and approve the PR
- Request changes – Reject with feedback on what must be fixed
- Add an optional summary comment.
- Click “Submit review”.
Once approved, your review will appear in the PR discussion and count toward any required reviews.
🖥️ How to Approve a PR Using GitHub CLI (Optional)
GitHub’s command-line interface also supports PR approvals.
- Install the GitHub CLI:
https://cli.github.com - Authenticate:
gh auth login
- Approve a pull request:
gh pr review --approve [PR-URL or number]
Example:
gh pr review 42 --approve
You can also request changes or comment:
gh pr review 42 --request-changes
gh pr review 42 --comment
🔐 When Is Approval Required?
Some repositories use branch protection rules to require:
- One or more code reviews
- Approval from specific teams
- Status checks (e.g., tests) to pass before merging
Until these criteria are met, the “Merge” button may be disabled.
🧠 Best Practices for Reviewing Pull Requests
- Read the description and context before reviewing
- Check for logic errors, code smells, and security concerns
- Ensure naming conventions and formatting match project standards
- Run the code locally if needed
- Be constructive and respectful in your comments
✅ Summary
Action | How |
---|---|
Open PR | Navigate to the Pull Requests tab in GitHub |
Review code | Use “Files changed” and leave inline comments |
Approve PR | Click “Review changes” > Select “Approve” > Submit |
CLI approval | gh pr review <PR#> --approve |
Conclusion
Approving a pull request is more than just clicking a button—it’s a vital step in maintaining code quality, fostering team collaboration, and ensuring every change is vetted and understood. With GitHub’s tools, you can give feedback and approval quickly and effectively, whether you’re working in the browser or the terminal.