How do I protect my contributions merged into another Github user's repo from that repo being deleted?

StackOverflow https://stackoverflow.com/questions/21276300

  •  01-10-2022
  •  | 
  •  

Question

AFAIK the canonical scenario for contributing to some public Github repo is the following:

  1. I fork that repo
  2. for each contribution I first push the changes to a branch in my repo and then send a pull request to the origin repo
  3. once a pull request is merged into the origin Github suggests that I "safely" delete the branch in my repo

The problem is this way all the contributions are not in my repo and so if the owners wish they can delete their repo and my contributions are effectively lost. Same if someone hacks into their account.

In case the project was under some irrevocable open source license like GPL or MIT (which is often the case) the project originally published can not be legally revoked and so I'm interested in my contributions and the original project being preserved.

Is there any way to somehow mirror the changes made to the other repo? Like maybe have it re-forked on each pull request merge so that once the changes have been accepted they also persist in my repo in the same way?

No correct solution

OTHER TIPS

The problem is this way all the contributions are not in my repo and so if the owners wish they can delete their repo and my contributions are effectively lost.

All Pull Requests are always accessible from the parent repo, even if the source branch (even if the source repo!) is deleted. You can always get it back.

If you care about a remote repository, you once contributed to, could be deleted, you could create a clone of this repo and keep it on a safe state, but this wouldn't be better than keeping your fork of the repo in GitHub.

I personally think, that it isn't an issue if someones account got hacked and the repo would be deleted. As GIT is a decentralized repository system, it's quite likely, that the author of the repo has a copy on his own machine. Specially on a system with more than one active contributor. That about deleting a repo by mistake or by hacking someones account.

If the owner of the repo should choose to delete the repository, you are quite lost. But if you've contributed to a project, it's quite likely, that you have it actively in use, don't you? So, your changes are not lost ... maybe the history in GIT will be if you haven't copied that over as well to your system in production.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top