News for hackers. Stuff that matters.
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.