Build the mental model
An issue is GitHub's unit for tracking anything that needs attention but is not yet code: a bug report, a feature request, a task, or an open discussion.
Unlike a pull request, an issue does not contain a branch or commits — it is just a discussion thread with a title, a description, and a status of open or closed, though GitHub can link the two together.
A well-written issue follows a predictable shape, and following it saves everyone time.
Problem
State the problem plainly first.
Expected vs Actual
Describe expected behavior — what should have happened — followed by actual behavior — what happened instead.
Steps to reproduce
For a bug, include steps to reproduce, numbered and specific enough that someone unfamiliar with the code could follow them and see the same failure.
Environment
Operating system, browser or runtime version, dependency versions — plenty of bugs only appear under specific conditions.
GitHub layers lightweight organization on top of this.
- Labels — categorize an issue at a glance (bug, enhancement, documentation, good first issue) and let you filter a busy repository
- Assignees — mark who is responsible, avoiding duplicated work
- Milestones — group related issues and pull requests toward a shared deadline or release
None of these are mandatory, but on any repository with more than a couple of contributors, they are what keeps work from becoming untraceable.
ISSUE LIFECYCLE
---------------
opened --> labeled/assigned --> in progress --> linked PR --> closed
| | | | |
title + bug/enhancement someone owns "Closes #12" merged PR
description milestone set it in a commit auto-closesConnect it to a real scenario
Nothing about browsing or filing issues happens in a terminal, but one small connection to local Git is worth knowing: commit messages and pull request descriptions can reference an issue by number, and specific keywords — Closes, Fixes, or Resolves followed by #<number> — get special treatment.
When a keyword gets merged
When a pull request containing one of those keywords is merged, GitHub automatically closes the referenced issue and leaves a note linking back to exactly which commit and pull request resolved it.
That link is permanent and searchable later, which is why searching commit history for an issue number, as shown below, is a genuinely useful habit even outside GitHub's website.
On the issue itself, expect to see the description at the top, followed by a comment thread below it where discussion happens over time, current labels and the assignee shown in a sidebar, and — once work starts — a linked pull request appearing automatically the moment someone opens one referencing that issue number, before the issue is even closed.
Try the working example
git init -q -b main
git config user.name "Thuta Learner"
git config user.email "learner@example.com"
cat > logger.js <<'EOF'
function log(value) {
console.log(value.toUpperCase());
}
EOF
git add logger.js
GIT_AUTHOR_DATE="2026-01-01T09:00:00" GIT_COMMITTER_DATE="2026-01-01T09:00:00" \
git commit -m "Add logger"
cat > logger.js <<'EOF'
function log(value) {
if (value === undefined || value === null) return;
console.log(value.toUpperCase());
}
EOF
git add logger.js
GIT_AUTHOR_DATE="2026-01-01T10:00:00" GIT_COMMITTER_DATE="2026-01-01T10:00:00" \
git commit -m "Fixes #12: guard against undefined input in logger"
git log --oneline --grep="#12"git log --oneline --grep="#12" ->
790939a Fixes #12: guard against undefined input in logger
On GitHub, merging a pull request whose commit or description contains a phrase like "Fixes #12" automatically closes issue #12 and adds a note on the issue linking back to this commit and pull request — a behavior specific to GitHub's web platform, not something git itself does.5-minute try-it
Write an issue for a hypothetical bug following the Problem / Expected / Actual / Steps to reproduce / Environment shape (no need to post it to GitHub — just draft it in your editor). Then write a commit message containing "Fixes #<number>" and search for it with git log --grep.
One important caution
Writing an issue like "it doesn't work" with no steps to reproduce, forcing a maintainer to guess how to recreate the bug
Writing "Fixes #12" in a commit message with a typo or wrong number, causing GitHub to auto-close the wrong issue
GitHub Docs: Creating an issue — Git & GitHub