What happens to the forks when deleting the original repository?
GithubGithub 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
-
If original private repo deleted: all of its forks will be deleted.
-
If original public repo deleted: its forks will not be deleted.
-
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.
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...
- ... public repo, you'll always have access to the respective files and folders (no matter if the repo is made private later on).
- ... private repo, all of its private forks are also deleted.