What happens to the forks when deleting the original repository?

Github

Github Problem Overview


I want to know what happens if the original repository is deleted when there are different forks. Do the forks stay on GitHub, or are the forks also deleted?

Github Solutions


Solution 1 - Github

It depends whether the original and the fork are public or private, according to GitHub's documentation:

> - Deleting a private repository will delete all of its forks. > - Deleting a public repository will not delete its forks.

More detail on this page:

> ### Deleting a private repository > > When you delete a private repository, all of its private forks are > also deleted. > > ### Deleting a public repository > > When you delete a public repository, one of the existing public forks > is chosen to be the new parent repository. All other repositories are > forked off of this new parent and subsequent pull requests go to this > new parent.

Solution 2 - Github

  1. If original private repo deleted: all of its forks will be deleted.

  2. If original public repo deleted: its forks will not be deleted.

  3. If public repo is converted to private, and deleted the original: forked repo will not be deleted.

    > a public repository's forks will remain public in their own separate repository network even after the parent repository is made private.

So, If you fork from a public repo, forked repo will not be deleted. If you fork from private repo, forked repo will be deleted.

Source: https://help.github.com/en/articles/what-happens-to-forks-when-a-repository-is-deleted-or-changes-visibility

Solution 3 - Github

Just to add further information: on Bitbucket a forked repository will not be deleted, when the parent is deleted. Found here: >If the original repository is deleted, the fork remains.

Solution 4 - Github

This answer is based in the documentation. Once you fork a...

  1. ... public repo, you'll always have access to the respective files and folders (no matter if the repo is made private later on).
  2. ... private repo, all of its private forks are also deleted.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJacquesView Question on Stackoverflow
Solution 1 - GithubjonrsharpeView Answer on Stackoverflow
Solution 2 - GithubmahfuzView Answer on Stackoverflow
Solution 3 - GithubJ-SchaeferView Answer on Stackoverflow
Solution 4 - GithubTiago Martins PeresView Answer on Stackoverflow