| 结构 | origin=自己的 Fork;upstream=上游仓库 |
|---|---|
| 路径 | Fork 分支开发 → 向上游提 PR/MR |
| 权限 | 贡献者无需上游写权限 |
常用示例
常用示例
git clone git@github.com:<你的账号>/repo.git
cd repo
git remote add upstream https://github.com/<上游组织>/repo.git
git fetch upstream
git switch -c fix/typo upstream/main适合开源与跨组织协作:上游通过评审与保护规则保留合并决定权。