How to review pull requests in GitHub

Code review through pull requests maintains code quality, catches bugs early, shares knowledge across teams, and ensures consistent coding standards. As the creator of CoreUI, a widely used open-source UI library, I’ve reviewed thousands of pull requests in open-source projects throughout my 25 years of development experience. The most thorough approach is examining changes in GitHub’s review interface, testing locally when needed, and providing specific feedback. This method ensures code quality, identifies issues before merging, and fosters collaborative improvement through constructive discussion.

Navigate to pull request, review file changes, add comments on specific lines, test locally if needed, then approve or request changes.

Review process in GitHub interface:

  1. Navigate to repository “Pull requests” tab
  2. Select PR to review
  3. Click “Files changed” tab to see diff
  4. Review each changed file:
    • Click line numbers to add inline comments
    • Click “+” icon to add multi-line comments
    • Suggest specific code changes with suggestion blocks

Example inline comment with suggestion:

Consider using async/await for better readability:

​```suggestion
const users = await fetchUsers()
​```
  1. Start review by clicking “Review changes” button
  2. Choose review type:
    • Comment: General feedback without approval
    • Approve: Changes look good, ready to merge
    • Request changes: Issues must be addressed before merging

Testing PR locally:

# Fetch PR branch
gh pr checkout 123

# Or manually:
git fetch origin pull/123/head:pr-123
git checkout pr-123

# Test the changes
npm install
npm test
npm run build

# Run application locally
npm start

# Return to main branch when done
git checkout main

Using GitHub CLI for review:

# View PR details
gh pr view 123

# View PR diff
gh pr diff 123

# Checkout and test
gh pr checkout 123

# Add review comment
gh pr review 123 --comment --body "LGTM! Great work on the authentication flow."

# Approve PR
gh pr review 123 --approve

# Request changes
gh pr review 123 --request-changes --body "Please add unit tests for the new authentication methods"

# View PR status and checks
gh pr checks 123

Here the Files changed tab displays all modifications with syntax highlighting and line-by-line diff. Inline comments provide specific, actionable feedback directly on relevant code. Suggestion blocks enable reviewers to propose exact code changes that authors can commit with one click. Testing locally verifies functionality beyond code inspection, catching runtime issues. The three review types (Comment, Approve, Request changes) clearly communicate review outcome. GitHub CLI streamlines review workflow for developers preferring terminal-based tools.

Best Practice Note:

This is the code review process we follow in CoreUI open-source development to maintain high code quality standards across thousands of contributions. Focus reviews on logic, security, performance, and maintainability rather than style preferences, test critical paths locally for complex changes, provide constructive feedback with specific examples and suggestions, and approve promptly when changes meet standards to maintain contributor momentum.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author

Subscribe to our newsletter
Get early information about new products, product updates and blog posts.

Answers by CoreUI Core Team