Improve your pull requests with Github templates

Darshana Prachi
3 min readJul 25, 2021

Adding a pull request template is a great practice as the project contributors will automatically see the pull request template rules you have added. It will also save you and your team a lot of time.

Adding the template

  1. Navigate to your GitHub repository in which you want to add the PR template and click on Add file -> Create new file

2. In the input box, name your file, write pull_request_template.md.
If you also want your template to be visible in your repository, place your file inside a directory by naming the pull request template like this docs/pull_request_template.md, where docs is the name of your directory.

3. Now, in the body of your file add the content you want for your template.

For my project, I am going to add the following points to my template. You can add, remove according to your requirements.

### Summary
<!-- Provide a detailed summary of your PR. -->
### Screenshot or Video
<!-- Add photos related to your feature -->
### What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] Feature
- [ ] Refactors
### Checklist
- Tested on
- [ ] **Chrome**
- [ ] **Safari**
- [ ] **Mobile**
- [ ] Added appropriate **tests**
- [ ] Added necessary comments
- [ ] Removed dead code

4. At the bottom of your file, add the appropriate commit message and commit the new file.

5. In your repository, you can now view the template you just made inside the docs directory.

Preview

Now if any of the project contributors make a pr, they can see it in action , and hence, it would be easier for the PR reviewers to check the PR as they wouldn’t have to check for the minor changes.

Feel free to contact me for any doubts or improvements.

--

--