I had a similar problem after updating to MacOS Catalina 10.15 and updating Xcode Command-line Tools (xcode-select --install
).
I received the above error when simply trying to do git status
. Then noticed I couldn't even do ls
. Apparently it's necessary grant Terminal, or iTerm in my case, "Full Disk Access".
- Go to System Preferences -> Security & Privacy -> Privacy tab
- Select "Full Disk Access" from the left-side menu
- Add Terminal and/or iTerm to the app list
See this article for more details: https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/
UPDATE - 1/2023: I recently updated to MacOS Ventura 13.1 and ran into the same issue. Running xcode-select --install
did the trick for me. Another helpful article.