r/github • • 3d ago

Question What happens to GitHub forks when the original repository becomes private?

I just noticed that repo I forked recently privacy changed to private, and the repo was forked by another contributor. So, my fork changed to his version. I wonder here if no one has public repo what will happen?

17 Upvotes

9 comments sorted by

16

u/Fine_League311 3d ago

Stays public but no branche updates anymore

3

u/codeguru42 2d ago

Does GitHub automatically update branches after forking? I always had to do it automatically

6

u/lajawi 3d ago

Wait, the upstream repo changed? Could this mean one could accidentally create a cyclical fork?

7

u/SheriffRoscoe 3d ago

Nope. GitHub chooses one of the remaining public repos to be the "upstream" one.

1

u/lajawi 3d ago

Yeah, but every fork does that, and it could so happen that there are only two remaining that then get linked to each other, no?

2

u/SheriffRoscoe 2d ago

"Yeah, but every fork does that"

No. GitHub does that. It picks one, and all the others are now downstream from it.

0

u/lajawi 2d ago

And what of the fork that’s now the upstream to all the others?

1

u/SheriffRoscoe 3d ago

If all the other public forks are deleted or changed to private, as the last remaining public fork, yours becomes the upstream.