How to set up GitHub/GitLab issue and PR templates
Templates for both GitLab and GitHub
Use the content that works best for you, here there are mine.
Template | Snippet |
issue | π GitHub snippet |
pull request / merge request | π GitHub snippet |
release | π GitHub snippet |
Basic
GitHub
- Create
.github
folder in project root. - Add templates files following this folder structure
βββ .gitlab/
β βββ ISSUE_TEMPLATE/
β β βββ issue-templates.md
β βββ PULL_REQUEST_TEMPLATE/
β β βββ merge-request-templates.md
β βββ RELEASE_TEMPLATE/
β β βββ release-templates.md
Commit and push on our default branch.
Check our project on GitHub. From now on, when we will open an issue, it will be pre-compiled with the markdown template we added.
GitLab
In GitLab is pretty much the same, but here we have to create a folder named .gitlab
, and add this folders structure:
βββ .gitlab/
β βββ issue_templates/
β β βββ issue-templates.md
β βββ merge_request_templates/
β β βββ merge-request-templates.md
β βββ release_templates/
β β βββ release-templates.md
Advanced
If we need different templates to choose, we have to add folders instead of files, and add many files as we need.
βββ .github
β βββ ISSUE_TEMPLATE
β β βββ bug-report.md
β β βββ feature.md
β β βββ nice-to-have.md
β βββ PULL_REQUEST_TEMPLATE.md
β βββ RELEASE_TEMPLATE
β β βββ default.md
β β βββ hotfix.md
π More info