Update "About forks" for scannability (#57154)
Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com> Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,13 @@ The term "source repository" refers to the repository you're importing, and "imp
|
|||||||
|
|
||||||
## Using forks
|
## Using forks
|
||||||
|
|
||||||
If the source repository is on {% data variables.product.prodname_dotcom %}, you may be able to use a fork instead of importing the repository. {% data reusables.repositories.about-forks %} For more information, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks).
|
If the source repository is on {% data variables.product.prodname_dotcom %}, you may be able to use a fork instead of importing the repository. Forks let you make changes to a project without affecting the original repository, also known as the "upstream" repository.
|
||||||
|
|
||||||
|
After you fork a repository, you can:
|
||||||
|
|
||||||
|
* Fetch updates from the upstream repository to keep your fork up to date
|
||||||
|
* Contribute back to the original project by creating pull requests from your fork
|
||||||
|
For more information, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks).
|
||||||
|
|
||||||
You can programmatically fork a repository using the REST API. For more information, see [AUTOTITLE](/rest/repos/forks).
|
You can programmatically fork a repository using the REST API. For more information, see [AUTOTITLE](/rest/repos/forks).
|
||||||
|
|
||||||
|
|||||||
@@ -16,43 +16,36 @@ topics:
|
|||||||
|
|
||||||
## About forks
|
## About forks
|
||||||
|
|
||||||
{% data reusables.repositories.about-forks %} A fork can exist in either a personal account or an organization.
|
Forks are like independent copies of repositories. Unlike branches, forks give you more freedom to experiment without affecting the original project. Unlike cloned or duplicated repositories, changes from forks can be merged back into the upstream repository via pull requests, similar to a branch.
|
||||||
|
|
||||||
When you view a forked repository on {% data variables.product.github %}, the upstream repository is indicated below the name of the fork.
|
When you view a forked repository on {% data variables.product.github %}, the upstream repository is indicated below the name of the fork.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
In open source projects, forks are often used to iterate on ideas or changes before incorporating the changes into the upstream repository. {% data reusables.repositories.about-giving-access-to-forks %}
|
## What makes forks distinct from branches
|
||||||
|
|
||||||
Deleting a fork will not delete the original upstream repository. Code pushed to a fork will be visible from the upstream, but changes won't have any immediate effect on the upstream branches. For example, you can add collaborators, rename files, or generate {% data variables.product.prodname_pages %} on the fork without affecting the upstream branches. {% ifversion fpt or ghec %} After a fork is deleted, you cannot restore the fork. For more information, see [AUTOTITLE](/repositories/creating-and-managing-repositories/restoring-a-deleted-repository).{% endif %} If you delete a private repository, all forks of the repository are deleted.
|
Each fork is a complete repository with its own:
|
||||||
|
|
||||||
{% data reusables.repositories.forks-page %}
|
* Branches
|
||||||
|
* Members and discussions
|
||||||
|
* Issues and pull requests
|
||||||
|
* Actions and projects
|
||||||
|
* Tags, labels, and wikis
|
||||||
|
|
||||||
## About creating forks
|
## When to use a fork
|
||||||
|
|
||||||
|
There are times when a fork may be a better fit for your task than a branch would be. A fork might be better:
|
||||||
|
|
||||||
|
* To experiment safely without affecting the original project
|
||||||
|
* To create separate space for discussions unrelated to a project's main goals
|
||||||
|
* When you might want to make your work an independent repository later
|
||||||
|
|
||||||
|
## Which repositories can be forked?
|
||||||
|
|
||||||
{% data reusables.repositories.you-can-fork %}
|
{% data reusables.repositories.you-can-fork %}
|
||||||
|
|
||||||
For instructions for forking a repository, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo). For more information about when you can create forks, and the permission and visibility settings of forks, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks).
|
## Next steps
|
||||||
|
|
||||||
> [!TIP]
|
For instructions for forking a repository, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
|
||||||
> {% data reusables.repositories.desktop-fork %}
|
|
||||||
|
|
||||||
## Forking a repository versus duplicating a repository
|
For more information about when you can create forks, and the permission and visibility settings of forks, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks).
|
||||||
|
|
||||||
If you want to create a new repository from the contents of an existing repository but don't want to merge your changes to the upstream in the future, you can duplicate the repository or, if the repository is a template, you can use the repository as a template. For more information, see [AUTOTITLE](/repositories/creating-and-managing-repositories/duplicating-a-repository) and [AUTOTITLE](/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).
|
|
||||||
|
|
||||||
Forking a repository is similar to duplicating a repository, with the following differences.
|
|
||||||
|
|
||||||
* Code pushed to a fork is visible to all repositories in the fork network, even after that fork is deleted.
|
|
||||||
* You can use a pull request to suggest changes from your fork to the upstream repository.
|
|
||||||
* You can bring changes from the upstream repository to your fork by synchronizing your fork with the upstream repository.
|
|
||||||
* Forks inherit the restrictions of their upstream repositories. For example, branch protection rules cannot be passed down if the upstream repository belongs to an organization on a {% data variables.product.prodname_free_team %} plan.
|
|
||||||
|
|
||||||
Like duplicated repositories, forks have their own members, branches, tags, labels, policies, issues, pull requests, discussions, actions, projects, and wikis.
|
|
||||||
|
|
||||||
## Further reading
|
|
||||||
|
|
||||||
* [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models)
|
|
||||||
* [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
|
|
||||||
* [Open Source Guides](https://opensource.guide/){% ifversion fpt or ghec %}
|
|
||||||
* [{% data variables.product.prodname_learning %}]({% data variables.product.prodname_learning_link %}){% endif %}
|
|
||||||
|
|||||||
@@ -41,7 +41,16 @@ If you delete a fork, any code contributions of that fork will still be accessib
|
|||||||
|
|
||||||
{% data reusables.repositories.private_forks_inherit_permissions %}
|
{% data reusables.repositories.private_forks_inherit_permissions %}
|
||||||
|
|
||||||
Public forks do not inherit the permissions structure of the upstream repository. {% data reusables.repositories.about-giving-access-to-forks %}
|
Public forks do not inherit the permissions structure of the upstream repository.
|
||||||
|
|
||||||
|
When you fork a public repository to your personal account, you can allow repository maintainers to push to your pull request branch. This includes giving them permission to make commits or delete the branch.
|
||||||
|
|
||||||
|
This speeds up collaboration by letting maintainers:
|
||||||
|
* Make direct commits to your branch
|
||||||
|
* Run tests locally before merging
|
||||||
|
You cannot give push permissions to a fork owned by an organization.
|
||||||
|
|
||||||
|
For more information, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork).
|
||||||
|
|
||||||
{% ifversion push-rulesets %}
|
{% ifversion push-rulesets %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,18 @@
|
|||||||
{% ifversion ghes or ghec %}
|
{% ifversion ghes or ghec %}
|
||||||
You can fork a private or internal repository to your personal account or to an organization on {% data variables.product.prodname_dotcom %} where you have permission to create repositories, provided that the settings for the repository and your enterprise policies allow forking. Generally, you can fork any public repository to your personal account or to an organization where you have permission to create repositories{% ifversion ghec %}, unless you're a member of an {% data variables.enterprise.prodname_emu_enterprise %}{% endif %}.
|
You can fork a private or internal repository to your personal account or to an organization on {% data variables.product.prodname_dotcom %} where you have permission to create repositories, provided that the settings for the repository and your enterprise policies allow forking.
|
||||||
|
|
||||||
|
Generally, you can fork any public repository to your personal account or to an organization where you have permission to create repositories{% ifversion ghec %}, unless you're a member of an {% data variables.enterprise.prodname_emu_enterprise %}{% endif %}.
|
||||||
|
|
||||||
{% elsif fpt %}
|
{% elsif fpt %}
|
||||||
You can fork any public repository to your personal account, or to an organization where you have permission to create repositories. If you have access to a private repository and the owner permits forking, you can fork the repository to your personal account, or to an organization on {% data variables.product.prodname_team %} where you have permission to create repositories. You cannot fork a private repository to an organization using {% data variables.product.prodname_free_team %}. For more information about {% data variables.product.prodname_team %} and {% data variables.product.prodname_free_team %}, see [AUTOTITLE](/get-started/learning-about-github/githubs-plans).
|
You can fork any public repository:
|
||||||
|
|
||||||
|
* To your personal account
|
||||||
|
* To an organization where you have permission to create repositories
|
||||||
|
|
||||||
|
If you have access to a private repository and the owner permits forking, you can fork the repository:
|
||||||
|
|
||||||
|
* To your personal account
|
||||||
|
* To an organization on {% data variables.product.prodname_team %} where you have permission to create repositories
|
||||||
|
|
||||||
|
You cannot fork a private repository to an organization using {% data variables.product.prodname_free_team %}. For more information about {% data variables.product.prodname_team %} and {% data variables.product.prodname_free_team %}, see [AUTOTITLE](/get-started/learning-about-github/githubs-plans).
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user