Skip to content

Commit f870039

Browse files
Sharra-writesnguyenalex836jc-clark
authored
Update "About forks" for scannability (#57154)
Co-authored-by: Alex Nguyen <[email protected]> Co-authored-by: Joe Clark <[email protected]>
1 parent c52b1b1 commit f870039

File tree

4 files changed

+49
-29
lines changed

4 files changed

+49
-29
lines changed

content/migrations/overview/programmatically-importing-repositories.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ The term "source repository" refers to the repository you're importing, and "imp
1717

1818
## Using forks
1919

20-
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).
20+
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.
21+
22+
After you fork a repository, you can:
23+
24+
* Fetch updates from the upstream repository to keep your fork up to date
25+
* Contribute back to the original project by creating pull requests from your fork
26+
For more information, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks).
2127

2228
You can programmatically fork a repository using the REST API. For more information, see [AUTOTITLE](/rest/repos/forks).
2329

content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,36 @@ topics:
1616

1717
## About forks
1818

19-
{% data reusables.repositories.about-forks %} A fork can exist in either a personal account or an organization.
19+
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.
2020

2121
When you view a forked repository on {% data variables.product.github %}, the upstream repository is indicated below the name of the fork.
2222

2323
![Screenshot of a repository's page on GitHub. Below the name of the repository, "mona/docs", the text "forked from github/docs" is outlined in orange.](/assets/images/help/pull_requests/fork-path.png)
2424

25-
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 %}
25+
## What makes forks distinct from branches
2626

27-
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.
27+
Each fork is a complete repository with its own:
2828

29-
{% data reusables.repositories.forks-page %}
29+
* Branches
30+
* Members and discussions
31+
* Issues and pull requests
32+
* Actions and projects
33+
* Tags, labels, and wikis
3034

31-
## About creating forks
35+
## When to use a fork
3236

33-
{% data reusables.repositories.you-can-fork %}
34-
35-
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).
36-
37-
> [!TIP]
38-
> {% data reusables.repositories.desktop-fork %}
37+
There are times when a fork may be a better fit for your task than a branch would be. A fork might be better:
3938

40-
## Forking a repository versus duplicating a repository
39+
* To experiment safely without affecting the original project
40+
* To create separate space for discussions unrelated to a project's main goals
41+
* When you might want to make your work an independent repository later
4142

42-
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).
43+
## Which repositories can be forked?
4344

44-
Forking a repository is similar to duplicating a repository, with the following differences.
45-
46-
* Code pushed to a fork is visible to all repositories in the fork network, even after that fork is deleted.
47-
* You can use a pull request to suggest changes from your fork to the upstream repository.
48-
* You can bring changes from the upstream repository to your fork by synchronizing your fork with the upstream repository.
49-
* 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.
45+
{% data reusables.repositories.you-can-fork %}
5046

51-
Like duplicated repositories, forks have their own members, branches, tags, labels, policies, issues, pull requests, discussions, actions, projects, and wikis.
47+
## Next steps
5248

53-
## Further reading
49+
For instructions for forking a repository, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
5450

55-
* [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models)
56-
* [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
57-
* [Open Source Guides](https://opensource.guide/){% ifversion fpt or ghec %}
58-
* [{% data variables.product.prodname_learning %}]({% data variables.product.prodname_learning_link %}){% endif %}
51+
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).

content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,16 @@ If you delete a fork, any code contributions of that fork will still be accessib
4141

4242
{% data reusables.repositories.private_forks_inherit_permissions %}
4343

44-
Public forks do not inherit the permissions structure of the upstream repository. {% data reusables.repositories.about-giving-access-to-forks %}
44+
Public forks do not inherit the permissions structure of the upstream repository.
45+
46+
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.
47+
48+
This speeds up collaboration by letting maintainers:
49+
* Make direct commits to your branch
50+
* Run tests locally before merging
51+
You cannot give push permissions to a fork owned by an organization.
52+
53+
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).
4554

4655
{% ifversion push-rulesets %}
4756

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
{% ifversion ghes or ghec %}
2-
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 %}.
2+
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.
3+
4+
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 %}.
35

46
{% elsif fpt %}
5-
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).
7+
You can fork any public repository:
8+
9+
* To your personal account
10+
* To an organization where you have permission to create repositories
11+
12+
If you have access to a private repository and the owner permits forking, you can fork the repository:
13+
14+
* To your personal account
15+
* To an organization on {% data variables.product.prodname_team %} where you have permission to create repositories
16+
17+
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).
618
{% endif %}

0 commit comments

Comments
 (0)