复刻仓库类似于复制仓库,主要有两点差异:
- 您可以使用拉取请求将更改从用户拥有的复刻提交到原始仓库,也称为上游仓库。
- 您可以通过同步复刻与上游仓库,将更改从上游仓库提交到本地复刻。
You can fork any public repository to your user account or any organization where you have repository creation permissions. For more information, see "Permission levels for an organization."
You can fork any private repository you can access to your user account and any organization on GitHub Team or GitHub Enterprise where you have repository creation permissions. You cannot fork a private repository to an organization using GitHub Free. For more information, see "GitHub's products."
您可以使用 GitHub Desktop 复刻仓库。 更多信息请参阅“从 GitHub Desktop 克隆和复刻仓库”。
删除复刻不会删除原始上游仓库。 You can make any changes you want to your fork—add collaborators, rename files, generate GitHub Pages—with no effect on the original. You cannot restore a deleted forked repository. 更多信息请参阅“恢复删除的仓库”。
在开源项目中,复刻常用于迭代想法或更改,然后将其提交回上游仓库。 在用户拥有的复刻中进行更改,然后打开拉取请求以比较您的工作与上游仓库,便可允许对上游仓库具有推送权限的任何推送更改到拉取请求分支。 这可加速协作,让仓库维护员在合并之前于本地从用户拥有的复刻对拉取请求进行提交或运行测试。 不可向组织拥有的复刻授予推送权限。
私有复刻继承上游或父仓库的权限结构。 例如,如果上游仓库是私有的,并授予团队读/写访问权限,则同一团队对该私有上游仓库的任何复刻拥有读/写权限。 这有助于私有仓库的所有者保持对其代码的控制。
If you want to create a new repository from the contents of an existing repository but don't want to merge your changes upstream in the future, you can duplicate the repository or, if the repository is a template, use the repository as a template. 更多信息请参阅“复制仓库" 和从模板创建仓库"。