Comparing pull requests in GitHub

Sara Verdi
Sara Verdi
Graphite software engineer

Comparing pull requests (PRs) is a core feature in GitHub that helps developers understand the changes proposed before merging them into the main branch. This process ensures that the changes are reviewed, discussed, and refined. This guide will explore how to use this functionality effectively along with Graphite's PR inbox.

To create a pull request, navigate to the repository where your branch exists. Click on the "Compare & pull request" button, which you can usually find right next to your recently pushed branches on the repository’s main page.

Screenshot

The base branch is where you want your changes to go, and the compare branch is where the changes are coming from. This is crucial for directing your changes correctly during the pull request.

  1. Select the base and compare branches: On the GitHub repository page, click on the "New pull request" button. Use the dropdown menus to select the base and the compare branches.
  2. Review the changes: GitHub will display the differences between the branches. You can navigate through the files to see additions, deletions, and other modifications.
  • PR not showing: If the "Compare & pull request" button is not showing, ensure you have pushed your branch to GitHub. Also, refreshing the page or checking your network settings can help resolve this issue.
  • PR without compare: You can still open a pull request without performing a comparison by directly selecting "New pull request" and choosing your branches, though comparing is recommended for clarity.
  • Troubleshooting non-functional buttons: If the "Compare & pull request" button or other interface elements are not working, check for browser compatibility issues or GitHub outages.

Screenshot

Graphite provides several enhancements to the standard GitHub pull request comparison process, primarily through its structured and feature-rich PR inbox. Here's how Graphite helps in comparing pull requests more effectively:

Graphite’s PR inbox organizes your pull requests into customizable sections like "Needs your review," "Approved," "Returned to you," and others. This structure helps you quickly identify which pull requests need your attention and compare changes across different branches and PRs systematically.

You can create new sections within your PR inbox with custom filters tailored to your workflow. For instance, you might have a section for urgent PRs only, or PRs that impact a specific part of your project. This ability to customize views allows you to compare pull requests that are relevant under specific criteria, making the comparison process more efficient.

With Graphite, you can search across all your PRs using fuzzy search capabilities, which means you can find PRs not only by their titles and descriptions but also by authors, labels, and more. This feature is particularly useful when you need to compare multiple pull requests related to a specific feature or bug fix.

Graphite enables you to share your customized PR sections and filters with teammates. This feature ensures that everyone on the team can view and compare pull requests under the same criteria, which is invaluable for maintaining consistency in code review processes across a large team.

By using Graphite along with GitHub, teams can not only compare changes within pull requests more effectively but also manage the overall flow of code reviews and approvals more efficiently, leading to faster and more reliable software development cycles.

Graphite
Git stacked on GitHub

Stacked pull requests are easier to read, easier to write, and easier to manage.
Teams that stack ship better software, faster.

Or install our CLI.
Product Screenshot 1
Product Screenshot 2