When I work with git on Windows 10 I never get this problem. But when I work with git in Ubuntu VM using VirtualBox it happens pretty often and it is really annoying. I know there is an answer for that, but is there any long term fix for that so it doesn't happen at all?
I have tried initializing another git repo and then pushing it to that new repo but that doesn't work.
It says something like this:
error: object file .git/objects/cf/... is empty
error: object file .git/objects/cf/... is empty
fatal: loose object ... (stored in .git/object/cf/...) is corrupt
I expect it to commit changes when I do git add .
and git commit -m "foo"
. But it gives that error pretty often.