Live data from Hacker News

Tell HN: GitHub will delete your private repo if you lose access to the original

news.ycombinator.com

141–150 of 294 posts

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#141

Earlier quoted context omitted.

"This unfortunately makes sense because it is a private repo." I disagree. I expect a (i.e. my) fork to be independent of the original repository, no matter if it is private or not. It's enough if a fork of a private repository is private then too.

Don't use the "Fork" button in the GitHub UI, then. It is intended for collaboration and establishes and maintains the parent-child relationship of "your fork" and if the parent repo is deleted, so are all forks. If the parent repo is private and goes public, so do all forks. If the parent repo is public and switches to private, so do all forks. This behavior is laid out in docs.github.com and is not secret. This has…

"If the parent repo is private and goes public, so do all forks."

nope, that's not true:

"GitHub will detach private forks and turn them into a standalone private repository. For more information, see "What happens to forks when a repository is deleted or changes visibility?""

" If the parent repo is public and switches to private, so do all forks."

This isn't true either:

"GitHub will detach public forks of the public repository and put them into a new network. Public forks are not made private."

In these cases, exactly what I would have expected happens.

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#142
post #132

Earlier quoted context omitted.

for me the exact meaning for private is "available for a selected audience"

Exactly. That implies that when a person is removed from the selected audience, they lose access to the private code.

to my private repository, but not their own private repository.

like it happens when a public repo goes private: I don't loose access to my fork of the repo but access to the original repo

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#143
post #7

I think this is under the assumption of "employee has a private fork of the company repo, then leaves, employee should not keep the fork" So when "removed as a collaborator" which apparently includes the original being deleted, you lose access to the main repo and all forks, even yours. As if leaving a company.

Yeah I understand how this is unfortunate but for 99% of cases this is what you want to happen when you remove someone's access to a private codebase. It seems like this is an unusual use case that OP had an MIT-licensed open source project whose source only exists in a private repo.

Is this scenario possible?

- you fork a public repo

- it's visibility is changed to private but you have access through the org

- they delete it

- you lose your fork, which was only ever of the public repo

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#144

Earlier quoted context omitted.

> If the YouTube algorithm nukes your account and all your videos, you should be ready to upload them to a new account. Same with anything else digital. Do you know if this is a common occurrence? Also, I'm only a YouTube viewer and am not familiar with all the creator tools, problems, communities, etc. But would a creator really re-upload all their back-catalog if deleted? Just to try to get back to views and things…

I remember someone posting an agonized screed, some time ago, about YT deleting their channel, and all the videos. Apparently, they had not kept the source/rendered originals of the videos, so it actually clobbered their business. I am a scarred, limping old coot, and have learned [the hard way] that backups are goooood .

> I am a scarred, limping old coot

That is a delightfully evocative phrase

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#145

If you have a Raspberry Pi wasting away in a drawer[0], I strongly recommend installing Gitea or Forgejo and mirroring all the repos you like (i.e. the ones you contribute(d) to and/or starred, not just on Github too!). You set it up once and it will sync in upstream changes as often as you like (default is daily) 0. Or a homelab, or a cheap 256MB VM, or a NAS that can run docker containers, or an old Chromebook: any…

I'll look for a tool that mirrors all my repositories (i.e. only forks). If I can't find one, I'll write it myself.

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#146

I have a number of git repos that the original developers deleted - because I sync’d them to a usb stick with gitea. I think that is how you have to do it - never entrust a service, especially a free one, with your only copy of anything you value. If the YouTube algorithm nukes your account and all your videos, you should be ready to upload them to a new account. Same with anything else digital. My current is standar…

> because I sync’d them to a usb stick with gitea Just a tip: no need to use gitea if you want to replicate a git repository to somewhere else on disk/other disk. Just do something like this: mkdir /media/run/usb-drive/my-backup-repo (cd /media/run/usb-drive/my-backup-repo && git init) git remote add backup /media/run/usb-drive/my-backup-repo git push backup master And now you have a new repository at /media/run/usb-…

Gitea has a cron task that pulls-in changes on an ongoing basis.

If a snapshot suffices, a once off "git push" or "git clone" works (but that's not too far off from downloading a tar ball, is it?). If you want to have a up-to-date local copies of multiple repos, a SQLite-backed Gitea instance is the simplest solution.

An added bonus to using Gitea is flexibility in mirroring LFS objects, which can be sent to S3 or minio

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#147
post #123

I'm not sure why people are defending Github on this issue, what if the original repo was a template or something, and your thousands of lines of code is gone because the original template repo removed you as a contributor. If I copy something, I expect where I copied it from to have exactly zero bearing on what happens to my copy. If they have a problem they can serve legal documents, giving everyone time to figure…

I agree completely. But at the same time - who doesn't have local copies of anything they care about? What are they thinking!?

You’d be surprised at how many use GirHub as their remote code backup platform. Having private file system backups is a question of culture, and a lot don’t have it.

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#148

Earlier quoted context omitted.

"This unfortunately makes sense because it is a private repo." I disagree. I expect a (i.e. my) fork to be independent of the original repository, no matter if it is private or not. It's enough if a fork of a private repository is private then too.

Don't use the "Fork" button in the GitHub UI, then. It is intended for collaboration and establishes and maintains the parent-child relationship of "your fork" and if the parent repo is deleted, so are all forks. If the parent repo is private and goes public, so do all forks. If the parent repo is public and switches to private, so do all forks. This behavior is laid out in docs.github.com and is not secret. This has…

That would make sense if they didn't use the word "fork" for it, that words has a specific meaning when talking about repositiories[0] and it doesn't include a automatically propagating deletions or settings of the original repo, it doesn't actually include ANY automatic propagation, therefore GitHub should use a different word for this kind of fork, something like "Crate child fork" or "Linked fork" or maybe a new word altogether

[0] http://www.freekb.net/Article?id=1263

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#149
post #143

Earlier quoted context omitted.

Yeah I understand how this is unfortunate but for 99% of cases this is what you want to happen when you remove someone's access to a private codebase. It seems like this is an unusual use case that OP had an MIT-licensed open source project whose source only exists in a private repo.

Is this scenario possible? - you fork a public repo - it's visibility is changed to private but you have access through the org - they delete it - you lose your fork, which was only ever of the public repo

no, in this case it works as expected;

"GitHub will detach public forks of the public repository and put them into a new network. Public forks are not made private."

https://docs.github.com/en/repositories/creating-and-managin...

But better be safe than sorry...

Re: Tell HN: GitHub will delete your private repo if you lose access to the original

#150
You can send the code to the Software Heritage:

https://archive.softwareheritage.org/save/

Perhaps there's a userscript to send everything that you fork there.

Ideally, federated forges will become more widely used: then a fork would mean copying the code to a forge of your choosing and there is less risk of losing code.

Post reply on HN