Comment by franky47
2 days ago
One of the beauties of Git is that as long as you’ve created an object, it’s impossible to lose that work (short of nuking the .git directory).
Committing often is key. Precommit hooks (that take more than ~100ms) go against that.
If you orphan the object by not having anything point to it, it goes away when "git gc" is run. That happens automatically after about two weeks by default.
Even things like "git add" will create objects stored in the .git folder.
I have had git corruption problems on a raspberry pi sd card, usually I just had to reclone/abandon that folder
It honestly sounds like git is the least of your problems here...