I am using a Raspberry Pi 4 as a C++ dev box using VS Code from my Windows 11 machine (SSH'd into the Linux box), and I have been getting a corrupted /.git directory more and more often.
I have successfully used the "The fix" series of steps from, Git: "Corrupt loose object" with great success. But. I'd rather that dir not be corrupted in the first place. So far, I have been using 'sudo reboot' after every successful 'git push' and the corruption hasn't shown up again. I'd rather not spend the several minutes that the reboot takes, so my ultimate question is,
Is there some way to ensure the /.git directory is intact and all relevant buffers are flushed, etc. such that I can keep working or power off the device without fear of another git corruption?