github-labels
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Labels
GitHub 标签管理
Reference for discovering and applying labels to GitHub PRs and issues.
为GitHub PR和Issue发现及应用标签的参考指南。
Discovering Available Labels
查看可用标签
bash
undefinedbash
undefinedList all labels with details
列出所有标签及详细信息
gh label list --json name,description,color --limit 50
gh label list --json name,description,color --limit 50
Search for specific labels
搜索特定标签
gh label list --search "bug"
gh label list --search "bug"
Output as simple list
输出为简单列表
gh label list --json name -q '.[].name'
undefinedgh label list --json name -q '.[].name'
undefinedAdding Labels to PRs
为PR添加标签
bash
undefinedbash
undefinedSingle label
添加单个标签
gh pr create --label "bug"
gh pr create --label "bug"
Multiple labels (repeat flag)
添加多个标签(重复使用参数)
gh pr create --label "bug" --label "priority:high"
gh pr create --label "bug" --label "priority:high"
Comma-separated
逗号分隔添加多个标签
gh pr create --label "bug,priority:high"
gh pr create --label "bug,priority:high"
Add to existing PR
为已有PR添加标签
gh pr edit 123 --add-label "ready-for-review"
undefinedgh pr edit 123 --add-label "ready-for-review"
undefinedAdding Labels to Issues
为Issue添加标签
bash
undefinedbash
undefinedCreate with labels
创建Issue时添加标签
gh issue create --label "bug,needs-triage"
gh issue create --label "bug,needs-triage"
Add to existing issue
为已有Issue添加标签
gh issue edit 123 --add-label "in-progress"
gh issue edit 123 --add-label "in-progress"
Remove label
移除标签
gh issue edit 123 --remove-label "needs-triage"
undefinedgh issue edit 123 --remove-label "needs-triage"
undefinedCommon Label Categories
常见标签分类
| Category | Examples |
|---|---|
| Type | |
| Priority | |
| Status | |
| Area | |
| 分类 | 示例 |
|---|---|
| 类型 | |
| 优先级 | |
| 状态 | |
| 领域 | |
Label Inheritance Pattern
标签继承模式
When creating a PR from an issue:
- Read issue labels via
gh issue view N --json labels - Apply same labels to PR:
gh pr create --label "label1,label2"
This maintains traceability and consistent categorization.
从Issue创建PR时:
- 通过查看Issue的标签
gh issue view N --json labels - 为PR应用相同标签:
gh pr create --label "label1,label2"
这能保持可追溯性和分类一致性。