GitHub Collaboration
Give issues and pull requests a repeatable shape so the team does not reinvent the same missing context.
Shape is GitHub; files are Git
GitHub Issues already required problem, expected result, and reproduction. GitHub Pull Requests already required what changed, how to verify, and Closes #N. This lesson makes those arguments the default on a repository you own, so the next issue is not a blank box.
The files
Templates are ordinary paths, usually under .github/. git add stages them. They travel with the clone.
The forms, labels, and board
GitHub prefills New issue and New pull request from those files. Labels and Projects live on GitHub. Clone the repo elsewhere and the files come along; the board columns do not become Git refs.
# These are Git. None of them is a GitHub template, label, or board.
git add README.md
git commit -m "Note"
git push origin mainUse a disposable GitHub repository you own. Do not push a .github folder onto a project you do not maintain. A contributing guide for outsiders is GitHub Contributing.
Issue templates
Put a markdown template at .github/ISSUE_TEMPLATE/bug.md. The YAML front matter is GitHub, not Git: it names the template in the chooser and can apply a label. The body should force the same complete report the Issues lesson already taught.
---
name: Bug
about: A problem with expected result and reproduction
labels: bug
---
## Problem
## Expected result
## Reproduction
1.
2.
3.
After this file is on the default branch, GitHub’s New issue page can offer Bug. If someone still files a one-line complaint, that is a process miss, not a missing Git object. Do not add six templates you will not use. One honest bug template is enough for this lab.
Front matter
name and about show in the template chooser. labels: bug applies a GitHub label if that label exists.
Body
Empty headings are prompts. Fill them when you file. A template that already contains a fake bug is worse than none.
Not a substitute for judgment
The template cannot invent a reproduction the reporter does not have. It can refuse to start from a blank description.
This lab
One bug template. Skip YAML issue forms and contact links until this markdown shape is live.
Pull request templates
GitHub reads .github/PULL_REQUEST_TEMPLATE.md (or docs/PULL_REQUEST_TEMPLATE.md) from the default branch and pastes it into a new pull request body. Match the description this course already treats as the minimum.
## Summary
## Linked issue
Closes #
## How to verify
1.
2.
Leave Closes # for the author to finish with a real number. A template that says Closes #1 on every pull request will close the wrong issue. Verify steps stay numbered and empty until the author writes them.
# From a clone of a GitHub repository YOU own
git switch main
git pull origin main
git switch -c feature/collaboration-shape
mkdir -p .github/ISSUE_TEMPLATE
# Write .github/ISSUE_TEMPLATE/bug.md and .github/PULL_REQUEST_TEMPLATE.md, then:
git add .github/ISSUE_TEMPLATE/bug.md .github/PULL_REQUEST_TEMPLATE.md
git diff --cached
git commit -m "Add issue and pull request templates"
git push -u origin feature/collaboration-shapeTest what you learned
Type the Git command that stages .github/PULL_REQUEST_TEMPLATE.md.
Open a pull request from feature/collaboration-shape so the templates themselves are reviewed. After it merges, the next New pull request on this repository should show the headings.
Labels that name a job
A label is GitHub metadata on an issue or pull request. It is not a Git tag. Create a label when you can say what it changes about the next action: file a reproduction, treat as docs, or close as not a bug.
gh label list
gh label create needs-repro --description "Issue is missing reproduction steps" --color D73A4A
gh label listTest what you learned
Type the GitHub CLI command that lists labels for this repository.
Test what you learned
Type the GitHub CLI command that creates a label (the name and flags come after).
needs-repro
The issue is missing the reproduction the template asked for. Next action: ask for steps, not start coding.
bug
The report names a problem and expected result. Next action: reproduce, then branch.
docs
The work is a README or template change, not a behavior change. Keep the pull request small.
Not a rainbow
Do not create twenty colors. Unused labels teach nothing. Delete or skip names you cannot explain.
gh label create talks to GitHub immediately. It does not wait for a commit. The template file still needs a commit and a merge onto the default branch before New issue uses it.
Boards are not branches
A GitHub Project (board) is columns of issues and pull requests: Todo, In progress, Done, or whatever names you choose. GitHub stores that view. git branch --list will not show it. Moving a card does not move HEAD.
What a board is for
See which complete issues are unstarted, which have an open pull request, and which are done—without rereading the Issues tab as a pile.
What it is not
Not a Git Flow develop branch. Not a substitute for a pull request. Not GitHub Actions.
This lab
Optional: in the GitHub UI, create a simple Project, add the practice issue, and drag it once. The required proof is templates plus labels. Do not automate Projects with GraphQL here.
Keep it small
Three columns beat eight empty ones. A board nobody updates is decoration.
What not to invent
Templates on a stranger’s repo
Do not open a pull request that only adds .github to a popular project as homework.
A contributing guide in this lesson
How an outsider forks and responds to review is GitHub Contributing. Keep this workshop on shape for a repo you own.
Actions as labels
A label named ci does not run tests. Workflows stay for GitHub Actions.
Blank-issue lockout
Do not set blank_issues_enabled: false on a solo practice repo until you have at least one working template. Locking the form with no template hides the Issues tab.
Guided practice: one repeatable shape
- 01Pick a repository you own
Confirm
git remote -vis your GitHub URL. Update localmain. - 02Add the two files
On
feature/collaboration-shape, add.github/ISSUE_TEMPLATE/bug.mdand.github/PULL_REQUEST_TEMPLATE.md. Open a pull request and merge it. - 03Create labels
gh label list. Createneeds-repro(andbugif GitHub did not already). Confirm the list. - 04File one issue from the template
Use New issue → Bug. Fill problem, expected result, and reproduction. Apply
bugif the template did not. - 05Optional board
Create a GitHub Project with Todo / In progress / Done. Put that issue on Todo. Do not spend the lab on automation.
Independent lab: collaboration shape
- On a GitHub repository you own, add
.github/ISSUE_TEMPLATE/bug.mdwith problem, expected result, and reproduction headings, and.github/PULL_REQUEST_TEMPLATE.mdwith summary, verify steps, andCloses #. Land them through a short-lived pull request, not a direct commit onmainif protection is on. - Run
gh label list. Createneeds-reprowithgh label createunless it already exists. - Open one GitHub issue using the bug template and fill every heading. Show that the New pull request form includes your template headings (open a draft or screenshot; you do not have to merge a second feature).
- Optional: add that issue to a GitHub Project board and name the columns.
- Write six lines: repository URL, issue template path, pull request template path, labels you created, one sentence that distinguishes a GitHub label from a Git tag, and one sentence that distinguishes a board from a branch. Do not add templates to a project you do not maintain.
Common collaboration mistakes
Empty templates
A file named bug.md that only says “describe here” still produces vague issues. Use the headings the Issues lesson already required.
Calling labels Git tags
Tags name commits. Labels classify GitHub conversations.
A board instead of a pull request
Dragging a card to Done does not merge main. The graph still needs a reviewed pull request.
Template spam on strangers
Your practice .github belongs on your practice remote.
Lesson review
You can give a repository you own a repeatable GitHub shape for issues and pull requests, keep labels as GitHub metadata, and refuse to treat a board as a branch. How an outsider forks and answers review is GitHub Contributing. A check reviewers can trust is GitHub Actions.
- I know templates are Git files that GitHub reads, not a
git templatecommand. - I can add
.github/ISSUE_TEMPLATE/bug.mdand.github/PULL_REQUEST_TEMPLATE.mdwith headings a stranger can fill. - I can
gh label listandgh label createfor a few jobs, not a rainbow of unused names. - I know a GitHub board organizes issues and pull requests and does not move Git refs.