Skip to content
Positive thinking will let you do everything better
than negative thinking will
Zig Ziglar

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.

issue template 01 issue template 02

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

View on GitHub

Comment on DEV.to or Hashnode

Take me to the next post!