Read Anthropic’s case study about Graphite Reviewer

How to add pull request templates 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.


Pull request (PR) templates are a useful tool to standardize the information included in pull requests, and they help ensure that all necessary details are communicated effectively. This guide will walk you through the process of setting up PR templates in GitHub.

GitHub PR templates help maintain a consistent format for pull request descriptions. They prompt contributors to include specific information, such as the purpose of the PR, associated tickets, and testing instructions. This can accelerate review processes and enhance communication among team members.

  1. Create a .github folder: On GitHub, navigate to the main page of the repository. Above the list of files, select the "Add file" dropdown menu, then click "Create new file".

  2. Add a PR template file: Inside the filename field, create a file named pull_request_template.md.

  3. Write your template: Fill the pull_request_template.md with the necessary sections that you want contributors to complete. Here’s a simple example:

    Terminal
    ## Description
    Describe the changes made and why they were made.
    ## Related issue
    Link or list the issue(s) this PR addresses.
    ## Type of change
    - [ ] Bug fix
    - [ ] New feature
    - [ ] Breaking change
    ## How has this been tested?
    Describe how you have tested these changes.
  4. Commit and push: Save the changes, commit, and push them to your main branch.

Graphite's PR inbox assists with managing pull requests by organizing them into a user-friendly interface that functions much like an email client, specifically tailored for pull requests. Here’s how it can enhance the use of GitHub PR templates:

  1. Categorization of PRs: Graphite creates default sections such as "Needs your review," "Approved," "Returned to you," "Merging and recently merged," "Drafts," and "Waiting for review." These sections help users immediately spot the PRs in different stages of the review process.

  2. Custom sections and filters: Users can customize or create new sections within their PR inbox. By using custom filters and preferences, you can align these sections with the specific information outlined in your GitHub PR templates. For example, if your PR template includes a section for urgent bug fixes, you can create a dedicated inbox section for PRs tagged with "urgent."

  3. Integration and synchronization: Graphite syncs with your GitHub repositories, ensuring that the PR inbox is always up-to-date with the latest pull requests, no matter if they follow a template or not. This synchronization helps maintain consistency in how PRs are viewed and managed, making it easier for team members to follow the standardized format provided by the templates.

  4. Sharing and collaboration: Graphite allows you to share your PR inbox configuration with teammates. This feature ensures that everyone on the team can view the same categorized sections based on shared filters, promoting a uniform approach to handling PRs. If your team adopts a specific template format, sharing these configured views ensures that everyone assesses PRs with the same criteria in mind.

  5. Search and navigation: The PR inbox includes capabilities for searching across PRs by title, description, author, and more. This feature is particularly useful when combined with structured PR templates because it allows team members to quickly find PRs based on the standardized information included in the template descriptions.

Overall, Graphite's PR inbox helps streamline the management and review of pull requests by providing an organized, custom interface for managing pull requests. Overall, Graphite’s PR inbox helps streamline the management and review of pull requests by providing an organized, custom

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