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 > General
page of your repository - In the
Features > Issues
section, clickSet up templates
button - 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 changes
to 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
main
branch of your repository - Click
Add file
to create a new file - Name the file
.github/pull_request_template.md
- In the body of the file, add your template:
Propose new file
and commit it directly to themain
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.
```
4.3 Create a template repository (Optional)
- Navigate to the
Settings > General
page of your repository - Select
Template repository
checkbox - Navigate to your repository list and click
New repository
- The
repository template
list 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 template
button
4.4 Create a Pull Request (Optional)
- Navigate to the
main
branch of your repository - Update the README.md file with checking the completed activities [x]
- Commit the changes into a new
feature/lab04
branch - Open a new pull request from
Pull requests
- The template you created will be displayed and used when creating a new PR