3 ms·
I know this is a silly hypothetical but say I forked it and then gutted the fork and built my own unrelated project in the repo. GitHub would delete my project
by Waterluvian 5y ago
I know this is a silly hypothetical but say I forked it and then gutted the fork and built my own unrelated project in the repo. GitHub would delete my project that contains zero offending material?
- detaro 5y agoyes. (afaik github forks of a repo really all point to the same repo internally)
- idealmedtech 5y agoThis is only true if you use the fork button. You can easily create a new repo, clone the old repo, and push to the new repo. GitHub will not show a fork relationship between the two.
- detaro 5y agotrue, I assumed that from the question, because otherwise it wouldn't be a fork in any way if the history has been deleted.
- charcircuit 5y agoI think he just means to create the repo like normal and push your fork there as opposed to creating a fork using the fork button.
- idealmedtech 5y agoEven if the history is exactly the same, GitHub only tracks forks made through the fork button. A true git fork (eg anonymous clone, push to brand new repo, preserving all commit history) is not tracked.
- detaro 5y ago... yes, that's what you already said?
- idealmedtech 5y agoBased on your comment I thought you only thought it applied when you deleted the history, just wanted to clarify.
- dotancohen 5y agoYour hypothetical project would not contain zero offending material. It's all still in the .git/ folder, in various forms that can be recovered.
- Waterluvian 5y agoEven with a force push that zeros history?
- dotancohen 5y agoI'm not really sure. Try it, then take a look at reflog and see what's still referenced. Check the size of the .git/ directory as well - is it smaller? There are some ways to rewrite history in git, but until git GCs I believe that they are mostly non-destructive. I'm sure that you could rm the .git/ and overwrite it but keep it pointing at the same repo. I don't know what would happen on the remote, though, when you push.
- justinclift 5y agoNope. If you remove the history too, then the content is gone. For good measure, you should also probably run a `git gc` (garbage collect) on the repo too, just to be sure. :)
- sumtechguy 5y agoI was under the impression that you could 'rewrite' history if you wanted by amending, squashing, and removing commits? Or does some of the artifacts still live on?
- dotancohen 5y agoUntil Git garbage collects, it's all still there (mostly). Sure there are some extraordinarily destructive things like `rm .git/` that you could do, but even if you point a new repo at remote it might not accept the merge (push).
- the_gipsy 5y ago