gh-abcs-developer

The GitHub ABCs developer training with templates, examples, hands-on labs and additional learning resources.

View project on GitHub

2 - GitHub Templates

In this lab you will create issue and pull request templates and make an existing repository a template.

Duration: 5-10 minutes

References:

2.1 Create issue templates

  1. Navigate to the Settings > General page of your repository
  2. In the Features > Issues section, click Set up templates button
  3. Select a template from the list
  4. Review the template by clicking on Preview and edit
  5. Edit the issue if needed to add your changes
  6. Click on Propose changes to commit the tempaltes to your repository.
  7. Repeat steps 3) to 6) to add more issue templates

2.2 Create pull request templates

  1. Navigate to the main branch of your repository
  2. Click Add file to create a new file
  3. Name the file .github/pull_request_template.md
  4. In the body of the file, add your template:
  5. Propose new file and commit it directly to the main branch ```markdown Fixes #

Changes proposed with this pull request:

Checklist

  • Check the commit’s or even all commits’ message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

```

2.3 Create a template repository

  1. Navigate to the Settings > General page of your repository
  2. Select Template repository checkbox
  3. Navigate to your repository list and click New repository
  4. The repository template list should contain your new repository template
  5. (Optional) Create a new repository from one of the templates
  6. (Optional) Navigate to your repository template and click on the Use this template button