Over a million developers have joined DZone.

GitHub Templates

DZone 's Guide to

GitHub Templates

For all you new comers to web dev, or those who are looking for a quick refresher, read on to learn how GitHub templates can assist in your product documentation.

· Web Dev Zone ·
Free Resource

In today’s web development world, Git is a powerful SCM (Source Control Management). GitHub is a web-based Git SCM Provider. These guys play an important role in all open-sourced projects, where you can see 95% of such projects.

GitHub's importance in open-source projects is made evident by the soaring number of contributors. It's important to note that internet giants like Facebook, Google and Microsoft have created their own organizational pages and published their projects. Let's get to the point. In this post, we are going to discuss GitHub Templates.

Why Do We Need Templates?

  1. GitHub introduces templates for their web forms (issues, pull requests, etc.), which can configure inputs to be pre-filled with data which will help maintainers to set up a questionnaire and help contributors to do their part fast.
  2. It’s hard and tough to solve a problem when important details about a contributor's project are missing in the pull request or in the issues folder. Both are web forms in GitHub where you can submit without an accompanying description, like below, which causes these contributions to become meaningless.

Bad Request — Pull Request with Empty Description

Let’s talk about the above Pull Request where the title and commit message says Header Changes. It’s hard to fathom this code change by Reviewers. It may be a great contribution, but this kind of code will give only a rough idea of which issues are most important. It may introduce new defects because they are not very clear about the current and new behavior.

How About With Descriptions? Let's Have a look!

Pull Request with Description

Above is a good and descriptive pull request which can be easily understood. Our goal should be to value the contributions and issue requests which will be reviewed and merge faster than usual.

So Github Templates Solve This Problem?

Yes. GitHub Templates help to configure your templates which will help to configure questionnaires. Now maintainers can add templates, but make sure your template file names are composed following proper naming conventions. Below is an example for an ISSUE Template.

GitHub Templates

It's always good to categorize your request as a pull request or an issue. Please read the Things you should know section for few more templates in various use cases provided by GitHub.

Things You Should Know

  1. Add PULL_REQUEST_TEMPLATE.md for Pull Request Template.
  2. Add Issue_TEMPLATE.md for Issue Template.
  3. Add CONTRIBUTING.md for Contribution Guidelines.
  4. Add CODE_OF_CONDUCT.md for Setting Coding Standard Guidelines.
  5. Add LICENSE or LICENSE.txt for License.
  6. You can keep it in the root directory or move all of them under the directory called .github.
  7. A file extension is optional, but Markdown files (.md) are supported.

You Are Done. Checkout How it Looks!

Cool, isn’t it?!

Happy coding, stay tuned for the next one!

github ,web dev ,product documentation

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}