How to Create an Issue on GitHub: Step-by-Step Guide
To create an issue on GitHub, go to the repository's
Issues tab and click New issue. Fill in the title and description, then click Submit new issue. Alternatively, use the GitHub CLI command gh issue create to create an issue from your terminal.Syntax
There are two main ways to create an issue on GitHub:
- Web interface: Navigate to the repository, click the
Issuestab, thenNew issue. - GitHub CLI: Use the command
gh issue createwith optional flags to specify title, body, labels, and assignees.
Example CLI syntax:
gh issue create --title "Issue title" --body "Detailed description" --label bug --assignee username
bash
gh issue create --title "Issue title" --body "Detailed description" --label bug --assignee username
Example
This example shows how to create a new issue on GitHub using the CLI with a title and description.
bash
gh issue create --title "Fix login bug" --body "Users cannot log in with correct credentials."
Output
Created issue #42: Fix login bug
Common Pitfalls
Common mistakes when creating issues include:
- Not providing a clear, descriptive title.
- Leaving the description empty or too vague.
- Forgetting to assign labels or assignees if needed.
- Trying to create issues in repositories where you don't have permission.
Using the CLI without authenticating first will cause errors.
bash
gh issue create --title "" --body "" # Wrong: empty title and body # Correct: gh issue create --title "Add user profile page" --body "Create a new page for user profiles with editable info."
Quick Reference
| Action | Command / Location | Description |
|---|---|---|
| Create issue (web) | Repository > Issues > New issue | Fill title and description, then submit |
| Create issue (CLI) | gh issue create --title "..." --body "..." | Create issue from terminal |
| Add label | --label | Tag issue for categorization |
| Assign user | --assignee | Assign issue to a collaborator |
| Authentication | gh auth login | Login to GitHub CLI before creating issues |
Key Takeaways
Use the GitHub web interface or CLI to create issues easily.
Always provide a clear title and detailed description for your issue.
Authenticate with GitHub CLI before creating issues from terminal.
Add labels and assignees to organize and track issues better.
Ensure you have permission to create issues in the repository.