I have the exact same problem! For me, this suddenly came to be last night, and after trying out EVERY suggested solution to no avail, I have come up with a solution that works for me.
Delete your working directory and start a new one. For me, I had to delete my entire “developer” folder. Copying and pasting the contents/folders does not seem to work. Manually backup all files/folders using git, delete the parent folder, create a new folder in its place, git clone. Done.
I really hope this helps. I wasted an entire day trying to solve this.
Anson