gitgit-extensions

Permission denied errors on random files during branch checkout


All of a sudden, I started receiving the following error when checking out my local master branch. The problematic file, as well as the error itself, appears to be random (sometimes the checkout works perfectly fine).

"c:\Program Files (x86)\Git\bin\git.exe" checkout --merge "master"
D   abc123.cs
error: unable to create file abc123.cs (Permission denied)
Switched to branch 'master'
Done

Solution

  • Daniel Hilgarth's anti-virus suggestion in the comments reminded me that I had run (and prematurely canceled) file recovery scans shortly before the problem manifested.

    It's possible these scan processes were causing the problem if they didn't cancel properly.

    Regardless, rebooting my machine fixed the issue.