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
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 the
You can have multiple pull request templates by creating a subdirectory within the parent one (
docs ) called
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.