Permission denied errors on random files during branch checkout

bugged87 picture bugged87 · Dec 10, 2012 · Viewed 35.2k times · Source

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

Answer

imsrgadich picture imsrgadich · Mar 1, 2017

Just closing the editor solved my issue. By the way, I was using Atom editor.