I've been hitting git repo corruptions lately. It happened whenever my virtual machine failed to resume from a saved state or error when saving its state. Whenever it happend, some objects became empty (commit, tree, blobs)
To clarify the matter, the other non-git data was ok. Only the data versioned-controlled by git encountered this problem.
I would like to understand on how did the corruption happen in the first place. The object is just a compressed contents,so, how did it become empty even tho it has been saved to the disk?
Also, kindly advice on how to prevent this from happening. I tried to have a local bare repo, but even the bare repo got corrupted. Most of the time I use my Virtual Machine for offline stuff, and dont have net connection. So, external repo is not an option.
Many thanks for any pointer.