I am a beginner. I try to use git to create the user's name. but when I typed
git config --global user.name "XXX"
the message shows
Unable to read current working directory: Operation not permitted.
I don't know what happened. How can I fix this problem?
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".
See this article for more details: https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/
Check your home directory and .gitconfig
file permissions using ls -l
command. If all is ok try to use sudo chattr -i .gitconfig
to check immutable attribute on this file.
You can find details about this command and file attributes here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With