How to Create Issue Templates for GitHub?

GitHub provides a simple issue tracker with a minimalist user interface. While this minimalism is often an advantage, it does not help the user report the important details to reproduce a bug:

The basic interface is simple but lacks guidance

As a result, you get a lot of issues where you need to ask the same questions all over again:

  • What version do you use?
  • What operating system?
  • Do you have a minimalistic example?

How would it be if we could show these questions right in the bug tracker? Our users could enter more meaningful entries and we could start reproducing the bugs instead of waiting on answers. GitHub knows about this problem, and they offer a solution: issue and pull request templates.

You can follow along the user guide and create those templates in the web interface. However, I prefer to create the files at the right place in the Git repository. In the top level of your repository, you need to create the folder .github/ISSUE_TEMPLATE/ .

The template has two parts, metadata for the template itself and the markdown that will be pre-filled in the issue form:

---
name: Bug report
about: Create a report to help us improve the T4.FileManager.VisualStudio
title: 'BUG: Short description of the problem'
labels: ''
assignees: ''
---

**Bug description**
Please explain what is wrong with the T4.FileManager.


**Your environment**
Version of T4.FileManager:
Version of .Net: 
Version of Visual Studio:
Operating System: 


**Minimalistic template**
Please share with us a minimalistic template to reproduce the bug.


**Expected behaviour**
What should happen? / What did you expect?


**What went wrong?**
What happened instead? What error message did you get?

Commit the template to the repository and push it to GitHub. If you now create an issue, you get an intermediate step where you can select your template(s) or create an empty entry:

With multiple templates you can guide your users to create the right entry

If your users now select the bug report they get your important questions right in the text box:

Your markdown template now asks your users for the important details

I like this feature very much and you can create a similar experience without much effort.