Adding a Pull Request template to your repository

Pablo Adell
2 min readJan 6, 2023
Photo by Roman Synkevych on Unsplash

Since 2017, Github release a feature to be able to create templates for your pull requests, so that each time a new PR was created, its description was not empty but the developer could use the template to provide some context.

In order to use this feature create a new file into your repository named PULL_REQUEST_TEMPLATE.md .

This file will contain the structure for your PR. It can be hidden by saving it under the folder.github or public, by storing it under thedoc folder.

You can have multiple pull request templates by creating a subdirectory within the parent one (.github / docs ) called PULL_REQUEST_TEMPLATE

And that’s it! Next time you create a new PR, the template will be automatically loaded in the description.

Take a look at my PR template repo for an example template with best practices 😁 → Here

I have divided it the way I like to work:

  • Changes: changes made to the current codebase (only if any part of the changes is not self-explainatory)
  • Context: Give context on why the change and pull request is needed and where the changes need comes from
  • Testing: Explain what tests were developed towards the code that was recently changed. This could help your reviewers better understand the changes.
  • Visual Support: If your code affected the UI or any other client-facing section, try to add screenshots or screen recordings that could help your colleagues better asses the PR.

And that’s all! Thanks a lot for reading me. See you around.

Pavs.

--

--

Pablo Adell

Hello there!! My name is Pablo, I am a Full-Stack Software Engineer at Affirm, focused mainly in Ruby on Rails and React. I hope you enjoy my content!