文章版本: Enterprise Server 2.17
关于复刻
复刻是您管理的仓库的副本。 复刻用于更改项目而不影响原始仓库。 您可以通过拉取请求从原始仓库提取更新,或者提交更改到原始仓库。
Forking a repository is similar to copying a repository, with two major differences:
- You can use a pull request to suggest changes from your user-owned fork to the original repository, also known as the upstream repository.
- 您可以通过同步复刻与上游仓库,将更改从上游仓库提交到本地复刻。
您可以将任何公共仓库复刻到您的用户帐户或任何您拥有仓库创建权限的组织。 更多信息请参阅“组织的权限级别”。
您可以将您具有访问权限的任何私有仓库复刻到您的用户帐户,以及 GitHub Team 或 GitHub Enterprise 上您拥有仓库创建权限的任何组织。 无法将私有仓库复刻到使用 GitHub Free 的组织。
您可以使用 GitHub Desktop 复刻仓库。 更多信息请参阅“从 GitHub Desktop 克隆和复刻仓库”。
Deleting a fork will not delete the original upstream repository. You can make any changes you want to your fork—add collaborators, rename files, generate GitHub Pages—with no effect on the original.
In open source projects, forks are often used to iterate on ideas or changes before they are offered back to the upstream repository. When you make changes in your user-owned fork and open a pull request that compares your work to the upstream repository, you can give anyone with push access to the upstream repository permission to push changes to your pull request branch. This speeds up collaboration by allowing repository maintainers the ability to make commits or run tests locally to your pull request branch from a user-owned fork before merging. You cannot give push permissions to a fork owned by an organization.
私有复刻继承上游或父仓库的权限结构。 例如,如果上游仓库是私有的,并授予团队读/写访问权限,则同一团队对该私有上游仓库的任何复刻拥有读/写权限。 这有助于私有仓库的所有者保持对其代码的控制。
如果以后要从现有仓库的内容创建新仓库,但不想合并上游更改,您可以复制仓库 。 更多信息请参阅“复制仓库"。