Sub topic 1
What issues are and how to create one
Prerequisites
This chapter assumes you already know the following:
- Basic Git and GitHub usage: repositories, branches, and commits.
- What a pull request is, at a high level.
- How to run commands in a terminal. The terminal appears only briefly here and is covered fully in a later chapter.
What an issue is
A GitHub issue is a numbered record in a repository. It describes a bug, a task, a question, or an idea. Each issue has a title, a body written in Markdown, and a comment thread. It also has metadata that you will learn to use in later chapters: labels, assignees, and milestones.
Issues are different from pull requests. A pull request proposes a change to code. An issue describes the need for a change, or any other piece of work. They share one number sequence in a repository, so if issue #41 exists, the next pull request will be #42. Teams usually open an issue first to agree on the problem, then open a pull request that fixes it.
An issue is always in one of two states: open or closed. Closing an issue does not delete it. You can reopen it later, and its history stays searchable.
Creating an issue in the web interface
You need a repository with issues enabled. Public repositories have them on by default. For a repository you own, check Settings, then General, then Features.
- Open the repository on GitHub and select the Issues tab.
- Select New issue. If the repository has templates, you will first see a list of them. Choose one, or choose to open a blank issue.
- Enter a title. Make it a short summary of the problem, for example "Date field accepts invalid values".
- Write the body. Describe what happened, what you expected, and how to reproduce it.
- Select Submit new issue.
GitHub assigns the next number and opens the issue page. The URL looks like https://github.com/OWNER/REPO/issues/42.
Creating an issue from the terminal
The GitHub CLI, called gh, can create issues without opening a browser. Run this command inside a cloned repository:
gh issue create --title "Date field accepts invalid values" --body "Entering 2026-13-45 is saved without an error." --label bug --assignee @meThe command prints the URL of the new issue. The --label option fails if the label does not exist in the repository, so check your label names first. A later chapter covers the CLI in more detail.
Who can create issues
On a public repository, any signed-in GitHub user can open an issue. On a private repository, you need at least read access. Repository owners can limit who may comment on issues, and maintainers can lock a conversation.
Common errors
- No Issues tab. Issues are disabled for the repository. An owner can enable them in the repository settings.
- A vague title. A title like "Bug" or "Doesn't work" makes the issue hard to find and triage later. Name the symptom.
- Using an issue for a general discussion. If the repository has Discussions enabled, open-ended questions belong there. Issues work best for items that someone can finish.
- Several problems in one issue. One issue should track one piece of work, so that you can close it cleanly. Split unrelated problems into separate issues.
Exercise
You open an issue in a repository and it gets the number #17. You then open a pull request in the same repository. What number does the pull request get, and why?
Show answer
It gets #18. Issues and pull requests share a single number sequence in a repository, so the next item of either kind takes the next number.
Exercise
Your teammate tries to run gh issue create with --label bug and the command fails. Name one likely cause.
Show answer
The repository has no label named "bug". The label must exist before you can apply it with --label, so create it first or use an existing label name.