r/github • • Oct 21 '26

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?

23 Upvotes

11 comments sorted by

20

u/Fine_League311 Oct 21 '26

Stays public but no branche updates anymore

3

u/codeguru42 Oct 22 '26

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

6

u/lajawi Oct 21 '26

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

8

u/SheriffRoscoe Oct 21 '26

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

1

u/lajawi Oct 21 '26

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 Oct 21 '26

"Yeah, but every fork does that"

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

1

u/lajawi Oct 22 '26

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

1

u/Specialist_Pair_8163 Oct 25 '26

Your fork remains public it’s like licenses that aren’t retroactive. If the repository creator changes the license tomorrow, it won’t affect you because you forked it when it was under a different license. The same applies here: your repository remains active and public, though if you want to change it, that’s entirely up to you

Besides, if there’s no main maintainer, another one is chosen which almost always falls to someone who was working on the repository or maybe the original owner handed it over to someone else and you didn’t realize it

Also, GitHub doesn’t allow you to change the visibility of a repository when it has forks (like yours)

And nothing will happen if there are no other forks besides yours, yours remains the original and will be an independent project

1

u/SheriffRoscoe Oct 21 '26

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