Issues and projects

Topic 4 of 4 in GitHub essentials6 min readBeginnerFree course

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.

From issue to merged fix: Issue #42 “Cart total ignores quantity” leads to a branch fix/42-cart-qty, then a pull request whose description says “Fixes #42”, then a merge — and the issue closes itself. Below, a GitHub Project board tracks issues and pull requests across columns: Todo (#51 dark mode), In progress (#47 search), In review (#42 cart qty) and Done (#39 login).

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.
Terminal
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:

  1. What happened — the actual behaviour, with error messages and screenshots.
  2. What you expected instead.
  3. Steps to reproduce — numbered, minimal.
  4. 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:

Text
Fixes #42
Closes #42, closes #43
Resolves acme/website#7

The 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

Terminal
gh issue develop 42 --name fix/42-cart-qty --checkout

This 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 issue and help wanted are 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.

Terminal
gh issue create --title "Add dark mode" --project "Website roadmap"

A lightweight process that works

For a small team or side project:

  1. Every piece of work starts as an issue (even a one-liner).
  2. Pick an issue, assign yourself, create a branch from it.
  3. Open a PR with Fixes #n.
  4. 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.

Exercise

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.

Terminal
# 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

Summary

  • Issues track bugs, features and tasks; each has a number, discussion, labels, assignees and a milestone.
  • Reference an issue anywhere with #number; Fixes #12 in a PR to the default branch closes it on merge.
  • Issue templates and forms make reports consistent; labels make them searchable.
  • gh issue develop creates a branch linked to an issue.
  • GitHub Projects boards and tables plan and track issues and PRs across their life.