I am working off of VMWare's virtual ubuntu 16.04 environment on an android studio project. The git is set up normally and works most of the time but I occasionally (at least three times in the past two months) get a corrupted git.
error: object file .git/objects/bb/2b004268181780ddea02ea4313142fc36a0541 is empty
error: object file .git/objects/bb/2b004268181780ddea02ea4313142fc36a0541 is empty
fatal: loose object bb2b004268181780ddea02ea4313142fc36a0541 (stored in .git/objects/bb/2b004268181780ddea02ea4313142fc36a0541) is corrupt
I am not asking how to fix those errors, I've already fixed them a couple times but they keep happening and it's really annoying and time consuming to fix. What is causing this to happen?
My normal day with git is to open VMWare, log into my virtual machine, and open up android studio, I don't touch git until the end of the day. I end the day one of two ways.
File -> Exit
on Android Studio, git commit stuff, then close VMWare. Then I shut down the desktop.Ctrl-alt-del
and set the desktop to locked mode.Or some variation of the two.
I usually encounter the corruption at the end of the day when I try to commit.
Additional VMWare settings:
Assuming the contents are valid, they contain a (single) tree ID (plus information about the commit: who made it, when, its parents, and so on). Git then extracts the tree contents by ID, and compares the checksum of the contents to the ID. This must match, or the tree contents are corrupted.
For those having the problem and disk size is not the issue this may help: I was powering down my machine and I kept getting git repo errors (I also noticed multiple journal recoveries on start up). I then tried Sending the Shutdown signal via the File menu; it indicated I had open files. I suspect the Shutdown allowed those files to close; I suspect some of them were git repo files.
That got rid of the journaling errors and so far I have not seen any git repo errors. Probably better is the ACPI Shutdown menu option under the Machine menu.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With