组织与团队
collaborators、teams、kanban-boards、automations。
30 分钟
组织与团队
公司或开源基金会常用 GitHub Organization 统一管理仓库、成员权限与项目看板。本课对应 git-github 路线图 的 collaborators、teams、kanban-boards、automations。
个人仓协作者见 ghg-repo;Issues/PR 见前几课;CI 自动化见 github-actions-essentials。
学习目标
- 区分 Personal account 与 Organization 的权限模型
- 配置 Team、仓库访问级别(read / write / admin)
- 使用 Projects 看板与基础 automations
Organization 结构
Organization(如 acme-corp)
├── Teams(backend、frontend、devops)
├── Repositories(按 team 授权)
└── Members(员工账号,可属多 team)
创建 Org:Settings → Organizations → New organization(免费 Team 计划即可入门)。
权限层级
| 级别 | 典型能力 |
|---|---|
| Read | clone、看 Issues/PR |
| Write | push 分支、开 PR(非保护分支) |
| Maintain | 管理 Issues、部分设置 |
| Admin | 仓库设置、删仓 |
Team @acme/backend 可被 @ 提及并批量 review。仓库 Settings → Collaborators and teams 添加 team 权限。
个人仓 vs 组织仓
个人练习仓用 Collaborators 邀请好友即可:
gh api repos/you/demo/collaborators/other-user -X PUT
组织仓通过 Team 绑定,离职时从 Org 移除成员即可收回全部仓库访问。
Projects 看板(Kanban)
Projects → New project → Board 或 Table:
- 列:Todo / In Progress / Done
- 卡片来源:Issues、PR 可拖入
- Automation:PR merged → 自动移到 Done
与 Issue labels、milestone 配合做 sprint:
Milestone v1.0
├── Issue #10 [backend]
├── Issue #11 [frontend]
└── PR #45 Closes #10
组织级安全
- Require 2FA for org members
- Audit log(付费计划)查看权限变更
- Branch protection 在 org 仓库统一模板