Git Notes
Labels and milestones are GitHub\
Labels and milestones are GitHub's built-in tools for organizing issues and pull requests. While issues capture individual tasks, labels categorize them and milestones group them into meaningful releases or time periods. Together, they transform a flat list of issues into a structured, filterable project management system that helps teams prioritize work and track progress toward goals.
Understanding Labels
Labels are colored tags you can attach to issues and pull requests. They serve multiple purposes: indicating the type of work (bug, feature, documentation), the priority level, the component affected, or the current status. A single issue can have multiple labels, giving you flexible, multi-dimensional categorization.
Creating and Managing Labels
Navigate to your repository's Issues tab, then click "Labels" to manage them. You can also use the GitHub CLI:
# Create a new label
gh label create "priority: high" --color "FF0000" --description "Urgent issues"
# List all labels
gh label list
# Edit an existing label
gh label edit "bug" --color "D73A4A" --description "Something isn't working"Designing a Label System
A well-designed label system makes issues scannable at a glance. Here is a proven categorization approach:
Type labels (what kind of work):
bug— Broken functionalityfeature— New capabilityenhancement— Improvement to existing featuredocumentation— Docs changesrefactor— Code restructuringtest— Adding or fixing testschore— Maintenance tasks (dependencies, configs)
Priority labels (how urgent):
priority: critical— Production is down, fix immediatelypriority: high— Needs attention this sprintpriority: medium— Normal backlog itempriority: low— Nice to have, address when time permits
Status labels (where in the workflow):
needs-triage— Newly created, not yet categorizedready— Defined and ready to be picked upin-progress— Actively being worked onneeds-review— Waiting for code reviewblocked— Cannot proceed due to a dependency
Area labels (what part of the system):
area: frontend— UI and client-side codearea: backend— Server and API codearea: database— Schema and query changesarea: infrastructure— CI/CD, deployment, DevOps
Contributor labels:
good-first-issue— Ideal for newcomers to the projecthelp-wanted— Extra attention needed from the community
Color Coding Strategy
Use consistent colors to make labels visually meaningful:
- Red shades — Bugs and critical priority
- Blue shades — Features and enhancements
- Green shades — Documentation and good-first-issue
- Yellow/Orange — Needs attention (triage, review needed)
- Purple — Refactoring and technical debt
- Gray — Chores and maintenance
Understanding Milestones
Milestones represent a target date or release version. They group related issues and show completion progress as a percentage bar. Think of them as containers that answer the question: "What needs to happen before we ship version X?"
Creating Milestones
# Using GitHub CLI
gh api repos/{owner}/{repo}/milestones -f title="v2.0.0" -f description="Major redesign release" -f due_on="2024-06-30T00:00:00Z"Or through the GitHub web interface: Issues → Milestones → New Milestone.
Each milestone has:
- A title (usually a version number or sprint name)
- An optional description explaining the goal
- An optional due date
- A progress bar showing percentage of closed issues
Using Milestones Effectively
Release-based milestones:
Sprint-based milestones:
Filtering with Labels and Milestones
The real power emerges when filtering:
| is | issue is:open label:"priority: high" milestone:"v2.0.0" |
| is | issue label:bug label:"area: frontend" assignee:username |
| is | pr label:"needs-review" no:assignee |
On the Issues page, click labels to filter instantly. Combine multiple labels to narrow results.
Automating Label Assignment
Use GitHub Actions to automatically label issues and PRs:
With a .github/labeler.yml configuration:
frontend:
- src/components/**
- src/pages/**
backend:
- src/api/**
- src/services/**
documentation:
- docs/**
- '*.md'Best Practices
Keep labels manageable. Having 50 labels is overwhelming. Aim for 15-25 well-defined labels that your team actually uses.
Enforce labeling. Make it a practice (or use automation) to label every issue when it is created. Unlabeled issues pile up and become impossible to prioritize.
Review milestones regularly. If a milestone has too many issues or keeps slipping its due date, break it into smaller milestones. An achievable milestone motivates the team.
Archive old milestones. Close milestones that are shipped. This keeps the active milestone list clean and provides a historical record of what was in each release.
Key Takeaways
Labels and milestones are simple tools that provide powerful project organization when used consistently. Design your label system around your team's actual workflow dimensions — type, priority, area, and status. Use milestones to group work into shippable units. Together, they make it easy to answer questions like "What bugs are blocking our release?" or "What high-priority features are assigned to me this sprint?" without digging through every individual issue.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Labels and Milestones.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Git & GitHub topic.
Search Terms
git-github, git & github, git, github, collaboration, labels, and, milestones
Related Git & GitHub Topics