Issues and projects
Overview
Code changes start with a reason: a bug someone found, a feature someone wants, a task on the roadmap. GitHub issues record those reasons, and Projects organise them into a plan. Linked to branches and pull requests, they connect every change in the history to why it was made.
Issues
An issue is a numbered discussion thread about one problem or idea. Each issue has:
- a title and description (Markdown, with images and checklists),
- comments from anyone with access,
- labels —
bug,enhancement,documentation,good first issue… - assignees — who’s working on it,
- a milestone — a target release or date,
- type and sub-issues for organisations that break big work down,
- links to related pull requests and commits.
gh issue create --title "Cart total ignores quantity" --label bug
gh issue list --label bug --state open
gh issue view 42
gh issue close 42 --reason "not planned"Writing a useful bug report
A good bug report saves hours:
- What happened — the actual behaviour, with error messages and screenshots.
- What you expected instead.
- Steps to reproduce — numbered, minimal.
- Environment — browser, operating system, version.
Templates and forms
Put templates in .github/ISSUE_TEMPLATE/. Markdown templates pre-fill the description; issue forms (.yml files) present proper form fields, can make fields required and apply labels automatically. A config.yml there can also point people to Discussions or a security policy instead of a blank issue.
Linking issues and pull requests
Type #42 in any issue, PR, comment or commit message and GitHub turns it into a link — and shows the reference on issue #42 as well, so the discussion and the code are connected both ways.
To close an issue automatically when a pull request is merged, use a closing keyword in the PR description:
Fixes #42
Closes #42, closes #43
Resolves acme/website#7The keywords are close, closes, closed, fix, fixes, fixed, resolve, resolves and resolved. They only take effect when the PR targets the repository’s default branch. They also work in commit messages that reach the default branch.
Branching from an issue
gh issue develop 42 --name fix/42-cart-qty --checkoutThis creates a branch linked to the issue (it shows under Development on the issue page) and checks it out locally. The website has a Create a branch link in the same place.
Labels and milestones
- Labels categorise and filter: by type (
bug,feature), area (area: checkout), priority (priority: high) or status (needs info).good first issueandhelp wantedare surfaced to new open-source contributors. - Milestones group issues for a release (“v2.0”) or a date, and show progress as issues close.
GitHub Projects
Projects are flexible planning views over issues and pull requests — from one repository or many:
- Board view: columns such as Todo → In progress → In review → Done, with cards you drag between them.
- Table view: a spreadsheet with custom fields (priority, estimate, sprint, dates).
- Roadmap view: a timeline of items with dates.
Built-in workflows keep the board in sync automatically — for example, set an item to Done when its issue closes or its PR merges. Create a project from your profile or organisation’s Projects tab, then add issues to it.
gh issue create --title "Add dark mode" --project "Website roadmap"A lightweight process that works
For a small team or side project:
- Every piece of work starts as an issue (even a one-liner).
- Pick an issue, assign yourself, create a branch from it.
- Open a PR with
Fixes #n. - Review, merge — the issue closes and the board updates itself.
Six months later, git blame on any line leads to a commit, which leads to a PR, which leads to an issue explaining exactly why the code exists.
Rule of thumb: if it’s worth doing, it’s worth an issue. If it’s worth discussing, discuss it on the issue — not in a chat that nobody can find later.
From bug report to closed issue
In your practice repository: create an issue reporting that the contact link in the footer is broken, with a bug label and yourself as assignee. Create a branch for it straight from the issue with gh issue develop, fix the problem, and open a pull request whose description closes the issue automatically. Merge it and confirm the issue closed. Bonus: add an issue form template so future bug reports ask for steps to reproduce.
# Inside your practice repository, with gh signed in
# 1. Create the issue (note the number gh prints, e.g. #3)
# 2. Branch from the issue
# 3. Fix, commit, push, open a PR that closes the issue
# 4. Merge and check the issue
# 5. Bonus: a bug report issue form# Inside your practice repository, with gh signed in
# 1. Create the issue (note the number gh prints, e.g. #3)
gh issue create --title "Footer contact link is broken" \
--body "Clicking **Contact** in the footer goes to /contct (404)." \
--label bug --assignee "@me"
# 2. Branch from the issue
gh issue develop 3 --name fix/3-footer-contact-link --checkout
# 3. Fix, commit, push, open a PR that closes the issue
echo '<footer><a href="/contact">Contact</a></footer>' > footer.html
git add footer.html && git commit -m "Fix footer contact link"
git push -u origin fix/3-footer-contact-link
gh pr create --base main --title "Fix footer contact link" --body "Fixes #3"
# 4. Merge and check the issue
gh pr merge --squash --delete-branch
gh issue view 3 # State: CLOSED
# 5. Bonus: a bug report issue form
git switch main && git pull
mkdir -p .github/ISSUE_TEMPLATE
cat > .github/ISSUE_TEMPLATE/bug_report.yml <<'EOF'
name: Bug report
description: Something isn't working
labels: [bug]
body:
- type: textarea
id: steps
attributes:
label: Steps to reproduce
placeholder: "1. Go to … 2. Click …"
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect to happen?
EOF
git add .github && git commit -m "Add bug report issue form" && git pushSummary
- Issues track bugs, features and tasks; each has a number, discussion, labels, assignees and a milestone.
- Reference an issue anywhere with
#number;Fixes #12in a PR to the default branch closes it on merge. - Issue templates and forms make reports consistent; labels make them searchable.
gh issue developcreates a branch linked to an issue.- GitHub Projects boards and tables plan and track issues and PRs across their life.