You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/migrations/overview/programmatically-importing-repositories.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,13 @@ The term "source repository" refers to the repository you're importing, and "imp
17
17
18
18
## Using forks
19
19
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).
21
27
22
28
You can programmatically fork a repository using the REST API. For more information, see [AUTOTITLE](/rest/repos/forks).
Copy file name to clipboardExpand all lines: content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md
+18-25Lines changed: 18 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,43 +16,36 @@ topics:
16
16
17
17
## About forks
18
18
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.
20
20
21
21
When you view a forked repository on {% data variables.product.github %}, the upstream repository is indicated below the name of the fork.
22
22
23
23

24
24
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
26
26
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:
28
28
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
30
34
31
-
## About creating forks
35
+
## When to use a fork
32
36
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:
39
38
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
41
42
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?
43
44
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 %}
50
46
51
-
Like duplicated repositories, forks have their own members, branches, tags, labels, policies, issues, pull requests, discussions, actions, projects, and wikis.
47
+
## Next steps
52
48
53
-
## Further reading
49
+
For instructions for forking a repository, see [AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
*[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).
Copy file name to clipboardExpand all lines: content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,16 @@ If you delete a fork, any code contributions of that fork will still be accessib
41
41
42
42
{% data reusables.repositories.private_forks_inherit_permissions %}
43
43
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).
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 %}.
3
5
4
6
{% 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).
0 commit comments