News for hackers. Stuff that matters.
Re:Tell HN: GitHub will delete your private repo if you lose... by csteinbe on Tuesday January 31, 2023 @03:43PM (#34601728)
Re:Tell HN: GitHub will delete your private repo if you lose... by fragmede on Tuesday January 31, 2023 @04:06PM (#34602113)
“But the plans were on display…”

“On display? I eventually had to go down to the cellar to find them.”

“That’s the display department.”

“With a flashlight.”

“Ah, well, the lights had probably gone.”

“So had the stairs.”

“But look, you found the notice, didn’t you?”

“Yes,” said Arthur, “yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of the Leopard.”

― Douglas Adams, The Hitchhiker's Guide to the Galaxy

Re:Tell HN: GitHub will delete your private repo if you lose... by agolio on Tuesday January 31, 2023 @04:17PM (#34602280)
To clarify the appropriateness of this analogy:

This is unexpected behaviour from Github here which may (and has, by the anecdote of OP) cause permanent data loss. Documentation is not good enough, as users should not have been expected to have read the entire documentation.

Re:Tell HN: GitHub will delete your private repo if you lose... by chrisfosterelli on Tuesday January 31, 2023 @04:38PM (#34602580)
I guess this is a question of who should have been given further information. For example, whoever at the organization deleted the repo would have been given a very clear warning screen including the number of forks that would be deleted by their action prior to them doing it.

On that note, an organization admin can _directly_ delete your private fork without even deleting the source repository if they want. GitHub's permission model is fairly direct that private forks you make through your membership in an organization are more the organization's property than the forker's.

Re:Tell HN: GitHub will delete your private repo if you lose... by capableweb on Tuesday January 31, 2023 @05:32PM (#34603291)
> I guess this is a question of who should have been given further information. For example, whoever at the organization deleted the repo would have been given a very clear warning screen including the number of forks that would be deleted by their action prior to them doing it.

This is exactly how it works today already. If I try to delete a private repository people have forked, I see the following:

> We will also delete all 4 forks since this is a private repository.

Clicking on the delete button, again:

> Unexpected bad things will happen if you don’t read this!

> This will also delete all 4 forks since this is a private repository.

> [type name of repository]

Re:Tell HN: GitHub will delete your private repo if you lose... by chrisfosterelli on Tuesday January 31, 2023 @05:42PM (#34603411)
Yes, that's what I said. It sounds like the parent poster is suggesting that the fork account should instead have that notice.
Re:Tell HN: GitHub will delete your private repo if you lose... by donmcronald on Tuesday January 31, 2023 @07:43PM (#34604637)
IMO it would be useful if non-obvious behavior like that were warned about when you fork the repo. I know I'd get burned by that. I keep a local mirror of everything though.
Re:Tell HN: GitHub will delete your private repo if you lose... by chrisfosterelli on Tuesday January 31, 2023 @07:49PM (#34604697)
That's a fair point.
Re:Tell HN: GitHub will delete your private repo if you lose... by alerighi on Tuesday January 31, 2023 @07:58PM (#34604818)
In my opinion in this case the fork shouldn't be allowed to be created at all. If this is the final effect it's better to inform the user that "no, we don't let you fork the repo". So he could have done it the normal way, clone the repo and push it with another remote, that would have not had this issue.

To this day I thought that the "fork" concept was only a relationship at the level of UI, but as I see it has a logic in it, that is the fork depends on the original repository even for permissions, and that to me is surprising!

Re:Tell HN: GitHub will delete your private repo if you lose... by chrisfosterelli on Wednesday February 01, 2023 @12:03PM (#34613551)
I think you're misunderstanding the way that a lot of orgs use forks. Many orgs will have the team fork the repo under their own account so they get their own working space, and then they make PRs from their forks back to the origin. Before branch protections it was also the best way to manage write permission. This is a really common pattern and not allowing it would break how a lot of people use github.

If the org doesn't work this way, it can disable forking so that it's not allowed at all on the repo (or org-wide), like you said.

Re:Tell HN: GitHub will delete your private repo if you lose... by themitigating on Tuesday January 31, 2023 @04:58PM (#34602861)
Is it unexpected though? The repo was forked from an org by the person who was a member of that org.

I know this isn't common but I actually use a unique user for my company "myname-company"

Re:Tell HN: GitHub will delete your private repo if you lose... by Barrin92 on Tuesday January 31, 2023 @05:14PM (#34603046)
I don't think it's an unexpected at all given that the original repo was private, not just the fork. Secondly a GitHub "user" isn't really a user in the consumer sense. They're a developer, as a developer/professional you can be expected to consult the documentation of a tool you use so you understand default behavior.
Re:Tell HN: GitHub will delete your private repo if you lose... by darekkay on Tuesday January 31, 2023 @04:09PM (#34602154)
That's why I usually don't use the official "fork" feature, but clone and push the repository manually instead. I would like to keep the fork network connection on Github, but I don't want to see my fork deleted because of an error, malice or simply lack of knowledge.
Re:Tell HN: GitHub will delete your private repo if you lose... by rezonant on Tuesday January 31, 2023 @04:12PM (#34602198)
It will only be deleted if the repo you fork from is a private repository. The documentation [1] covers the other scenarios, in all of which you keep your copy of the code (including when the public repository is made private later).

[1] https://docs.github.com/en/pull-requests/collaborating-with-...

Re:Tell HN: GitHub will delete your private repo if you lose... by andyjohnson0 on Tuesday January 31, 2023 @04:39PM (#34602601)
> It will only be deleted if the repo you fork from is a private repository

This makes sense. Thank you for clarifying that important detail. It seems to be missing from the parts of the discussion I've read here.

Re:Tell HN: GitHub will delete your private repo if you lose... by TheRealPomax on Tuesday January 31, 2023 @05:10PM (#34602995)
No, it doesn't. It only makes sense until you stop and go "Wait, no, hold on a minute. Why would they delete the fork instead of simply severing the fork relation in their fork relations table?".
Re:Tell HN: GitHub will delete your private repo if you lose... by Ferret7446 on Wednesday February 01, 2023 @11:26PM (#34622064)
Consider:

You have access to many private company files. After you leave the company, the company is obligated to send you copies of all of the files because you may have linked to them. After all, you could have made personal copies of all of the files, so you should still retain access through links.

Re:Tell HN: GitHub will delete your private repo if you lose... by darekkay on Tuesday January 31, 2023 @04:19PM (#34602310)
TIL, thanks! I probably confused this with the GitHub takedowns, when forks are removed as well (as it happened to the youtube-dl repo). I could imagine my manual clone not withstanding such takedown either, though.
Re:Tell HN: GitHub will delete your private repo if you lose... by rezonant on Tuesday January 31, 2023 @04:25PM (#34602404)
Yeah for cases like that, keep a local copy, thankfully many people did
Re:Tell HN: GitHub will delete your private repo if you lose... by remram on Tuesday January 31, 2023 @05:20PM (#34603129)
What if the original is made private and then deleted? Does your fork remain?
Re:Tell HN: GitHub will delete your private repo if you lose... by vlz on Tuesday January 31, 2023 @07:56PM (#34604792)
Yes, the docs linked above say:

"If a public repository is made private and then deleted, its public forks will continue to exist in a separate network."

https://docs.github.com/en/pull-requests/collaborating-with-...

Re:Tell HN: GitHub will delete your private repo if you lose... by account42 on Wednesday February 01, 2023 @10:32AM (#34611881)
IIRC GitHub will also delete the entire fork network for DMCA request even if your fork is not mentioned explicitly.
Re:Tell HN: GitHub will delete your private repo if you lose... by devmunchies on Tuesday January 31, 2023 @05:39PM (#34603390)
Same. Another reason is I don't like how Github inserts "Forked from ..." in the project name. If your "fork" becomes extremely divergent after a couple years (maybe you had a different vision for the project), you are still stuck with the "Fork from..." sub-header, which basically tells users that they should look at the original. I'm otherwise fine putting attribution in a README.
Re:Tell HN: GitHub will delete your private repo if you lose... by djur on Tuesday January 31, 2023 @08:01PM (#34604843)
Right, the entire point of GitHub forks is to make it easier to upstream your local changes to the original repository. If you have no interest in doing that you shouldn't use a fork.
Re:Tell HN: GitHub will delete your private repo if you lose... by slikrick on Wednesday February 01, 2023 @07:34AM (#34609608)
you know you can fork dead and abandoned projects right?
Re:Tell HN: GitHub will delete your private repo if you lose... by djur on Wednesday February 01, 2023 @01:06PM (#34614756)
Sure, you can. It might not be a good idea in the long term.
Re:Tell HN: GitHub will delete your private repo if you lose... by account42 on Wednesday February 01, 2023 @10:34AM (#34611910)
Which is pretty much the opposite of what fork used to mean before GitHub...