Git and GitHub · Part 3 · GitHub and remote repositories

Issues, labels and Projects

Where work is written down

A bug mentioned in a chat is forgotten by Friday. An issue is a numbered page in the repository for one piece of work: a bug, a feature, a question. It has a discussion, an owner and a status, and links to the code that solves it. Pull requests say how something changed; issues say why.

Writing a good issue

Click the Issues tab, then New issue. A bug report someone can act on without asking questions:

Issue #12: Cart total is wrong after removing an item
## Steps to reproduce
1. Add two items to the cart
2. Remove one
3. Look at the total

## Expected
The total shows the price of one item.

## Actual
The total still shows both items.

## Environment
Chrome 131, macOS, production site

The title says what's wrong, not “Cart broken”. A feature request says what's needed and why, not only the solution.

Organizing issues

ToolWhat it's forExample
LabelsThe kind of work, or its prioritybug, enhancement, good first issue
AssigneesWho is doing itjknithin36
MilestonesA group with a due datev1.2.0, Sprint 14
ProjectsA board for planning across issuesTodo → In progress → Done

Every new repository comes with a set of labels, such as bug, documentation, enhancement, good first issue and help wanted. Edit them under Issues, then Labels.

Linking issues and pull requests

Writing #12 in any comment, commit message or pull request links to issue 12. A closing keyword goes further:

Pull request description
Fixes #12

When that pull request is merged into the default branch, issue 12 closes by itself. close, closes, fix, fixes, resolve and resolves all work, and so do their past tenses. Each issue needs its own keyword: Fixes #12, fixes #15.

Issue templates

Templates make every bug report ask for the same details. They are files in .github/ISSUE_TEMPLATE/:

.github/ISSUE_TEMPLATE/bug_report.md
---
name: Bug report
about: Something isn't working
labels: bug
---

## Steps to reproduce

## Expected

## Actual

After it's pushed, New issue offers it as a choice, with the bug label already added. A .github/pull_request_template.md file does the same for every new pull request's description.

Projects

A Project is a planning board that holds issues and pull requests, even from several repositories. Create one from the repository's Projects tab. It has three views of the same items:

  • Board: columns like Todo, In progress and Done. Dragging a card changes its status.
  • Table: a spreadsheet with custom fields, such as priority or size.
  • Roadmap: items on a timeline, by date or iteration.

Built-in workflows move cards automatically, for example to Done when the issue closes, so a merged pull request with Fixes #12 updates the board with no clicks.

Quick reference

TaskCommand
Create an issuegh issue create --title "…" --label bug
List open issuesgh issue list
List your issuesgh issue list --assignee @me
View an issuegh issue view 12
Close an issuegh issue close 12
Close one from a pull requestFixes #12