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?
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.
Deleting a repository will permanently delete release attachments and team permissions. This action cannot be undone. Deleting a private repository will delete all forks of the repository.
You are unable to fork a repo twice on Github (as of late 2021) but if you want to build on the same repo multiple times, you can use the "Import Repository" option and feed it the URL used to clone.
To sync your forked repo with the parent or central repo on GitHub you: Create a pull request on GitHub.com to update your fork of the repository from the original repository, and. Run the git pull command in the terminal to update your local clone.
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.
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.
Source: https://help.github.com/en/articles/what-happens-to-forks-when-a-repository-is-deleted-or-changes-visibility
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With