11

For instance, there is a repo called foo.

There are three forks of it called foo-bar, foo-baz and foo-baq which were created sequentially.

foo is updated quite frequently. Forks are more or less outdated, e.g., foo-baq is the freshest one (but not as fresh as foo) and foo-bar is the oldest one.

What happens when the owner of foo deletes it? Which of the forks is chosen as the main repo (i.e. shown as "forked from" in two other forks)?

4

Provided that the main repository is public, the oldest fork is selected to become the parent:

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.

Source: GitHub Help: What happens to forks when a repository deleted or changes visibility?

Update #1: Doing some rudimentary testing (creating multiple forks and then deleting the parent), it appears that the oldest fork becomes the parent.

Update #2: I emailed the support team, and this is the reply I received:

Hi ---,

Thanks for getting in touch. That's correct, the oldest fork is promoted to be the new root repo. However, they original root repo owner can contact us beforehand to switch the root to whichever repo they'd like.

Let us know if you have any other questions.

Cheers, Jamie

  • @redredwine Right. Will update with info soon. – AccioBooks Aug 7 '16 at 1:09
  • @redredwine updated answer with experimental data – AccioBooks Aug 7 '16 at 1:15
-1

Anyone of the fork can be chosen as a main repository.

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

  • 2
    Always add essential contents of the link into answer. – serenesat Dec 27 '15 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.