Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens to the forks when deleting the original repository?

Tags:

github

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?

like image 946
Jacques Avatar asked Oct 29 '18 19:10

Jacques


People also ask

What happens to fork when original repo is 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.

What happens when you delete a repository in GitHub?

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.

Can you fork the same repository twice?

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.

How do I sync forked with original repo?

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.


2 Answers

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.

like image 54
jonrsharpe Avatar answered Oct 06 '22 12:10

jonrsharpe


  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

like image 28
mahfuz Avatar answered Oct 06 '22 14:10

mahfuz