4 ms·
Your hypothetical project would not contain zero offending material. It's all still in the .git/ folder, in various forms that can be recovered.
by dotancohen 5y ago
Your 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 agoGithub’s “fork relationship” is not stored in .git/ in any way.
- dotancohen 5y agoNo, but the github server is configured as remote for anything checked out from Github. And I don't know how the remote will handle a merge (push) from a repo with rewritten history.
- the_gipsy 5y agoIt could not be "recovered" by git in any way.