Read Anthropic’s case study about Graphite Reviewer

What to do when your pull request is rejected

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.


Handling the rejection of a pull request can be a challenging yet educational experience for any developer. When a pull request is denied, it's important to seek out the reasons, understand them, address them, and resubmit your changes. This guide will show you what to do when your pull request gets rejected and explore how using Graphite's PR inbox can help this often daunting process.

First, clarify why your pull request was rejected. Common reasons might include failing tests, code that doesn't adhere to project guidelines, incomplete features, or merge conflicts. Review comments from reviewers carefully to identify any issues or areas for improvement. This feedback is critical in guiding your next steps.

Next, open a dialog with the reviewers. If the feedback isn't clear, ask for clarification. This can often be done directly within the pull request comments section, and it makes sure a record of the discussion is kept for future reference.

Based on the feedback, make the necessary changes to your code. It's important that you address every issue that was brought up and reference the commit that fixes each issue in the resubmission to make it easier for reviewers to verify changes.

Graphite's PR inbox serves as a centralized hub for your PRs to help you focus on the pull requests that require your attention. After addressing the feedback and updating your pull request, you can monitor its progress in the "Returned to you" or "Waiting for review" sections of your Graphite PR inbox. This setup simplifies the management of multiple pull requests to make sure that none are overlooked, particularly when revisions are necessary.

Run all tests to ensure your changes haven’t introduced new issues. It's good practice to add new tests that cover the changes you've made, demonstrating your commitment to quality and preventing future regressions.

Once your revisions are complete, push the changes to the existing branch associated with the pull request, which will automatically update the pull request. Leave a comment summarizing the changes made in response to the feedback, linking back to the original discussion when possible.

After resubmitting, monitor the pull request for additional feedback. If your pull request involves significant changes, consider requesting a re-review from the original reviewers.

Having a pull request rejected isn't the end of the road—it's a step in the development process that leads to better, more reliable software. With tools like Graphite's PR inbox, you can manage revisions and resubmissions more effectively, turning setbacks into learning opportunities. Remember, the key to dealing with a rejected pull request is to stay proactive, responsive, and organized.

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