Read Anthropic’s case study about Graphite Reviewer

How to approve a pull request in GitHub

Sara Verdi
Sara Verdi
Graphite software engineer
Try Graphite


Note

This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.


Approving a pull request in GitHub is a step in the code review process that make sure changes meet the necessary quality standards before they are merged into the main branch. This guide will explain how to approve pull requests through the GitHub interface and using command line tools, and how Graphite's PR inbox can help with this process.

  1. Access the repository: Start by navigating to the GitHub repository where the pull request has been made.
  2. Open the pull request: In the repository, go to the "Pull Requests" tab and click on the pull request you want to review.
  1. Examine the files: Click on the "Files changed" tab to view the modifications made in the pull request.
  2. Leave comments: If you have any suggestions or require changes, you can leave comments directly on the line of code by clicking the plus icon next to the line.
  1. Leave a review: After reviewing the changes, click on the "Review changes" button in the "Files changed" tab.
  2. Approve the pull request: Select "Approve" from the options and submit your review. This will officially approve the changes.

Screenshot

Graphite's PR inbox acts provides an organized interface for your pull requests to help you stay productive:

  1. Access Graphite: Log into your Graphite account and navigate to your PR inbox.
  2. Review sections: Use the inbox sections to quickly find pull requests that need your attention, like those in the "Needs your review" section.
  3. Approve via Graphite: Open the pull request from your inbox and approve it directly within Graphite, which syncs with GitHub.

Screenshot

  1. Check for merge conflicts: Ensure there are no conflicts with the main branch.
  2. Merge the pull request: If you also have merge permissions, you can click on "Merge pull request" to merge the approved changes into the main branch.

For those who prefer terminal commands, you can approve a pull request using the GitHub CLI:

  1. Install GitHub CLI: Ensure that GitHub CLI is installed on your machine.
  2. Approve the pull request: Use the command gh pr review --approve to approve the pull request of the current branch.

Approving a pull request in GitHub is fairly straightforward, whether through the web interface or the command line, and Graphite's PR inbox can further simplify the process by making it easier to manage and review pull requests efficiently. With the combined power of Graphite and GitHub, you can gain the clarity needed to handle approvals swiftly and make sure no request goes unnoticed or unattended.

Git inspired
Graphite's CLI and VS Code extension make working with Git effortless.
Learn more

Built for the world's fastest engineering teams, now available for everyone