4 - 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:
- Issue & pull request templates
- Configuring issue templates for your repository
- Creating a pull request template for your repository
- Creating a template repository
- Creating a repository from a template
4.1 Create issue templates
- Navigate to the
Settings > Generalpage of your repository - In the
Features > Issuessection, clickSet up templatesbutton - Select a template from the list
- Review the template by clicking on
Preview and edit - Edit the issue if needed to add your changes
- Click on
Propose changesto commit the tempaltes to your repository. - Repeat steps 3) to 6) to add more issue templates
4.2 Create pull request templates
- Navigate to the
mainbranch of your repository - Click
Add fileto create a new file - Name the file
.github/pull_request_template.md - In the body of the file, add your template:
Propose new fileand commit it directly to themainbranch ```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.
```
4.3 Create a template repository (Optional)
- Navigate to the
Settings > Generalpage of your repository - Select
Template repositorycheckbox - Navigate to your repository list and click
New repository - The
repository templatelist should contain your new repository template - (Optional) Create a new repository from one of the templates
- (Optional) Navigate to your repository template and click on the
Use this templatebutton
4.4 Create a Pull Request (Optional)
- Navigate to the
mainbranch of your repository - Update the README.md file with checking the completed activities [x]
- Commit the changes into a new
feature/lab04branch - Open a new pull request from
Pull requests - The template you created will be displayed and used when creating a new PR