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:
@@ -16,43 +16,36 @@ topics:
|
||||
|
||||
## 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.
|
||||
|
||||

|
||||
|
||||
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 %}
|
||||
|
||||
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]
|
||||
> {% data reusables.repositories.desktop-fork %}
|
||||
For instructions for forking a repository, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
|
||||
|
||||
## Forking a repository versus duplicating a repository
|
||||
|
||||
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 %}
|
||||
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).
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
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 %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user