Setting Up a Pull Request Template for your GitHub Repo
Steps to setup a pull request template on your repositories.
I have been upgrading and updating many of my pubicly available repositories related to .Net C#, Node JS and JavaScript. It’s a wealth of material that I have built and collected over the last 12 years. I also noticed a reasonable amount of traffic coming to my repos.
It’s possible that some students might choose to contribute to my repos, and I have started adding pull request templates to all my repos. I think, PR templates help provide a standardized request for essential information from contributors who otherwise might have their own way of presenting the information.
Here is what you should do.
Create the .github directory
You could create this folder manually. Or you could use a command that creates the folder for you.
PS D:\CodingJan2025Onwardsc\CPPForStudents> mkdir -p .github
Directory: D:\CodingJan2025Onwardsc\CPPForStudents
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 21-Feb-25 6:03 PM .github
PS D:\CodingJan2025Onwardsc\CPPForStudents>
Create the pull request template file
Once again, manually, or with commands.
PS D:\CodingJan2025Onwardsc\CPPForStudents\.github> ls
Directory: D:\CodingJan2025Onwardsc\CPPForStudents\.github
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 21-Feb-25 6:07 PM 0 PULL_REQUEST_TEMPLATE.md
PS D:\CodingJan2025Onwardsc\CPPForStudents\.github>
Add the template content
Here is one possible template content.
# Pull Request
## Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (issue)
## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
- [ ] Test A
- [ ] Test B
## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
Save and commit the changes
I am sure you know, how to commit the changes. Of course, I do have a handy blog post about git commands, right here.
when it is all done, this is how it would look.
Just want to add that you can also add a template for a issue as well. I am yet to start configuring it in my repos though.
I work as a coding tutor. You can hire me on Upwork, Fiverr and Codementor. You can also book a session on calendly, and visit my website. Also, video tutorials on my YouTube Channel.