Permission denied errors on random files during branch checkout

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


I don't know if you're using sublime text, but when I got the permission denied problem, I noticed there was a license notice popup; that tries to get you to donate to sublimetext3 every once in a while.

Once I closed that popup and ran the commands again, the denied permission errors went away and everything worked fine.

I extrapolate that other editors with popup notices may cause this issue.

Rebooting, as bugged87 mentioned, would certainly get rid of any popups or notifications.


In my case, my angular app was still running from ng serve, giving this:

Git Bash - ng serve

So I just had to close it with ctrl+c.


The same happened with me a time ago and I've closed my VScode, typed git checkout and it worked!