How to create a PR template in Github repository


github pull request Tutorials

If you worked with open-source repositories you might have noticed that 90% of them have already configured pull request templates.

It can bring a standard for PRs in the project and simplify work for contributors:

An example of PR template in Ionic repo

To create an automatic template for pull requests in your repository:

  • create docs or .github directories. The template in docs folder will be visible and in the .github vice versa;
  • create PULL_REQUEST_TEMPLATE.md in one of these directories. Also, you can call it pull_request_template.md and use a .txt format;

Folder with PR template

You can configure multiple pull request templates for different types of issues. For example, to create predefined templates for bug reports, feature requests, and etc. Here is one example:

THIS PROJECT IS IN MAINTENANCE MODE. We accept pull-requests for Bug Fixes **ONLY**. NO NEW FEATURES ACCEPTED!

<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

Using the PR template, your next pull request can be look in a different way. You can check a collection of Github pull request templates.

comments powered by Disqus