Search code examples
gitvirtual-machinevmwarecorruption

How do I prevent my git from corrupting?


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.

  1. I click File -> Exit on Android Studio, git commit stuff, then close VMWare. Then I shut down the desktop.
  2. Same as 1 except I leave VMWare open, I don't git commit that day, 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.

Hard Disk Settings

Additional VMWare settings:


Solution

  • I made a new VM that has twice the size and the problem hasn't occurred since then so I'm going to go ahead and assume that's the answer. If I see it again I'll update this.