Pull Request Templates
A PR template is a markdown file checked into your repo that GitHub uses to pre-fill the description box every time a PR is opened. It’s the cheapest way to enforce a team standard — instead of nagging people to fill in “what / why / how to test”, the template just appears, and most people fill it in.
Where to put the template
GitHub looks for a template in three locations (any one works; pick one):
.github/pull_request_template.md← most commondocs/pull_request_template.mdpull_request_template.mdat the repo root
A minimal template
.github/pull_request_template.md
## Summary <!-- One or two sentences. What does this PR do? --> ## Why <!-- Link to the issue or describe the motivation. --> ## How to test <!-- Steps a reviewer can follow to verify the change. -->
A detailed template
A richer template for larger teams
## Summary <!-- One or two sentences --> ## Type of change - [ ] Bug fix (non-breaking) - [ ] New feature (non-breaking) - [ ] Breaking change - [ ] Documentation / chore ## Related issues Closes # ## What changed <!-- Bullet list of the meaningful changes --> ## Screenshots / recordings <!-- For UI changes, drop in a screenshot or short Loom --> ## How to test 1. 2. 3. ## Checklist - [ ] I added tests for the new behaviour - [ ] I updated the README / docs where relevant - [ ] I checked that CI passes locally (`npm test && npm run lint`) - [ ] I considered the rollback story - [ ] I notified anyone whose code I’m changing ## Risk and rollback <!-- What could break? How would we roll this back? -->
Multiple templates
Create a folder of templates and let contributors choose per PR.
Folder layout
.github/
└── PULL_REQUEST_TEMPLATE/
├── feature.md
├── bugfix.md
├── docs.md
└── chore.mdContributors pick a template via URL parameter:
Append ?template=NAME.md to the compare URL
https://github.com/acme-co/widget/compare/main...add-csv-export?template=feature.md
What a good template includes
Summary — one paragraph headline.
Motivation / linked issues — closes #N, fixes #M.
Type of change — checkboxes help triage and changelog generation.
Testing instructions — explicit steps the reviewer can follow.
Screenshots — required for UI work; reviewers will fill it in anyway.
Checklist — “I added tests / docs / changelog entry”.
Rollback — what to do if this breaks in prod.
Issue templates
GitHub has a parallel system for issue templates (bug reports, feature requests, questions). They live in .github/ISSUE_TEMPLATE/ and are covered in detail on the Issue Templates page.
GitLab equivalent
GitLab calls them Merge Request templates, stored in .gitlab/merge_request_templates/. The mechanics are identical — markdown files that pre-fill the description.
GitLab MR template layout
.gitlab/
└── merge_request_templates/
├── feature.md
├── bugfix.md
└── Default.md ← used when nothing is selectedCommon pitfalls
Template too long — people skip sections. Aim for fewer than 10 bullets.
Vague headings — "Description" tells the author nothing. "How to test" gets actual instructions.
Mandatory fields nobody fills in — markdown can’t enforce. Use Issue Forms (YAML) if you need required fields.
Template lives only on one fork — must be in the upstream repo for PRs from forks to see it.
Real-world workflow
Add a template to a repo
mkdir -p .github $EDITOR .github/pull_request_template.md git add .github/pull_request_template.md git commit -m "Add PR template" git push # Next PR will auto-populate with the template