Read Anthropic’s case study about Graphite Reviewer

How to create a release 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.


Creating a release pull request ensures that all changes intended for release are reviewed and merged systematically. This guide will cover how to create a release pull request in GitHub, best practices for setup, and how the Graphite's PR inbox can improve your workflow.

A release pull request is a PR that is specifically created to merge code changes from a development branch into a designated "release" branch, which signifies that the code within the PR can be included in the next release. The release PR triggers a final review and approval of changes before deployment to production, ensuring quality and minimizing risks.

Start by creating a dedicated release branch in Git. A release branch is a snapshot of your current main branch that you refine before merging back into main. This helps in isolating the release process from ongoing development.

Terminal
# Switch to main
git checkout main
# Pull the latest changes
git pull origin main
# Create and switch to a new release branch
git checkout -b release/v1.0

Push the release branch to GitHub:

Terminal
git push -u origin release/v1.0

Once the release branch is pushed, create a pull request (PR) to merge the release branch into the main branch.

  1. Navigate to the GitHub repository.
  2. Go to the "Pull Requests" tab and click "New pull request."
  3. Select release/v1.0 as the source branch and main as the target branch.
  4. Add a descriptive title, such as "Release v1.0 Pull Request."
  5. In the description, summarize the release, including:
    • Major changes or features included.
    • Links to related pull requests or issues.

The Graphite PR inbox can streamline release management by organizing PRs needing your attention. You can add custom filters to track release-related PRs.

  1. Open your Graphite PR inbox.
  2. Click "Add new section."
  3. Use filters such as branch name (release/*) or labels like release to display release-specific PRs.

This setup ensures you never miss important updates during your GitHub release PR workflow.

Follow these practices to optimize your release pull request workflow:

  • Use labels and milestones: Apply labels like release and assign a milestone to group PRs related to a release.
  • Review commit history: Ensure commits are atomic, meaning each commit represents a logical unit of change.
  • Add reviewers: Assign reviewers familiar with the changes to improve the review process.
  • Run CI/CD pipelines: Configure GitHub Actions or another CI tool to validate the release branch with automated tests.
  • Squash commits: If there are multiple minor commits, squash them during the merge to maintain a clean commit history.

After approval and successful CI tests, merge the release pull request into the main branch. Use GitHub’s "Squash and merge" or "Merge commit" strategy depending on your team’s preferences.

Terminal
# Switch to main
git checkout main
# Merge the release branch
git merge --no-ff release/v1.0

By following these steps and best practices, you can effectively create and manage release pull requests in GitHub. Plus, by using tools like Graphite's PR inbox, you can handle even the most complex releases with confidence and efficiency.

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