I just started using git and I install git and gpg via homebrew.
For some reason, I get this error when i do git commit
I looked at so many other stackoverflow
Issue: Disabled loopback pinentry mode
To solve the problem, you need to enable loopback pinentry mode in ~/.gnupg/gpg.conf:
cat <<'EOF' >> ~/.gnupg/gpg.conf
use-agent
pinentry-mode loopback
EOF
And also in ~/.gnupg/gpg-agent.conf (create the file if it doesn't already exist):
cat <<'EOF' >> ~/.gnupg/gpg-agent.conf
allow-loopback-pinentry
EOF
Then restart the agent with
echo RELOADAGENT | gpg-connect-agentand you should be good to go!
Source