I ran into this exact same issue on a new workstation and the fix for me was to give my specific user Modify rights on the .git folder even though I already had Full Control rights which includes the Modify right. And I confirmed this is required by removing my Modify right and leaving the Full control and got the error again. I could only make the error go away by giving myself Modify rights. How I even thought of looking at this is that fortunately I had one folder that was working correctly and one that was not on the same workstation and that was the only difference. On both folders I had Full Control, but on the one that was working I also had a Modify rights ACL as well.