Apple - ls: : Operation not permitted - Mojave security?
A less drastic way:
Go to System Preferences > Security & Privacy and give Full Disk Access to Terminal.
Adapted from https://discussions.apple.com/thread/8637915
This did it for me
Steps:
Apple menu -> System Preferences -> Security & Privacy -> Privacy -> Full Disk Access -> +
Choose:
Applications -> Utilities -> folder -> Terminal -> open/grant terminal full disk access privileges. -> Relaunch terminal
In my case helped simply:
chflags -R nouchg .
This code I used in terminal in folder with problematic file.
Source: https://txcowboycoder.wordpress.com/2011/01/10/svn-cant-move-svntmpentries-operation-not-permitted/