Template

A pull request template to copy.

A good pull request description gets a faster, better review: the reviewer knows what to look for before reading a line of the diff. Here is a template to copy, what each part is for, and how to make GitHub fill it in for every new pull request.

Free to start. macOS (Apple silicon and Intel), Windows and Linux.

The template

Copy this into a file named pull_request_template.md and adjust the sections to your team.

## What changed
<!-- One or two sentences. What does this pull request do? -->

## Why
<!-- The problem it solves or the ticket it closes. Link it. -->
Closes #

## How to test
<!-- Steps a reviewer can follow, or the tests that cover it. -->
1.

## Risks
<!-- What could this break? Data, migrations, shared code, permissions. -->

## Screenshots
<!-- For anything a user can see. Before and after if it changed. -->

## Checklist
- [ ] Tests added or updated
- [ ] Docs updated if behaviour changed
- [ ] No secrets, debug code or commented-out code

What each section is for

  • What changed: the summary a reviewer reads first. If it takes more than a few sentences, the pull request may be doing too much.
  • Why: the context that is not in the code. A link to the ticket lets the reviewer check the change against what was asked.
  • How to test: saves the reviewer from guessing, and often catches a missing case while you write it.
  • Risks: the most useful section and the most skipped. Naming what could break tells the reviewer where to look hardest.
  • Screenshots: a picture of a UI change is faster to review than its CSS.
  • Checklist: short and specific. A long checklist gets ticked without being read.

Versions for bug fixes and features

Bug fix

## Bug
<!-- What was wrong, and how to reproduce it. Link the issue. -->

## Cause
<!-- Why it happened. -->

## Fix
<!-- What this changes, and the test that now reproduces the bug. -->

## Risks

Feature

## What it does
<!-- From the user's side. -->

## How it works
<!-- The main pieces, and where to start reading. -->

## How to test

## Rollout
<!-- Feature flag, migration order, anything to do after merging. -->

## Screenshots

Where GitHub looks for templates

GitHub fills the description of every new pull request from a template named pull_request_template.md in the repository root, in docs/, or in the hidden .github/ folder. For several templates, put them in a PULL_REQUEST_TEMPLATE/ folder and pick one with the template query parameter. Templates only apply once they are merged into the default branch. The full rules are in GitHub's documentation.

.github/pull_request_template.md
.github/PULL_REQUEST_TEMPLATE/bug_fix.md
.github/PULL_REQUEST_TEMPLATE/feature.md

Filling it in faster

The hardest section to fill in well is Risks, because it needs you to know everything your change reaches. Nodeway, a desktop app that maps your repository on your own computer, shows exactly that: the functions your branch changes and everything that calls them, up to the routes, components, tables and tests they reach. You can copy that summary into the description as Markdown or as a Mermaid diagram.

Nodeway can also open the pull request for you. Its Create pull request sheet fills the title and body from your commits, can write the body with AI, and pushes the branch before it opens the pull request on GitHub. The guide on how to review a pull request covers the other side.

Questions

Where do I put a pull request template on GitHub?

Save it as pull_request_template.md in the repository root, in docs/, or in the hidden .github/ folder. For several templates, put them in a PULL_REQUEST_TEMPLATE/ folder inside one of those. GitHub only uses templates once they are merged into the default branch.

How do I choose between several templates?

Add the template query parameter to the URL that opens the new pull request, with the template's file name, for example ?template=bug_fix.md. Without it, GitHub does not pick one of several for you.

What should a pull request description include?

What changed and why, how to test it, what it might break, and a link to the ticket or issue. Screenshots for anything visible. Keep it short enough that a reviewer reads it before the diff.

Can a pull request description be written automatically?

Partly. Commit messages give a first draft, and AI tools can summarise the diff. The why, the risks and how to test still need the author, because they are not in the code.

See your whole codebase in minutes.

Open a folder and Nodeway maps it on your own computer. No account, and nothing is uploaded.

More guides