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
For me this error started to occur with git tag -s
on Debian GNU/Linux when I switched from pinentry-gnome3
to pinentry-curses
(using update-alternatives --config pinentry
) for easier remote access. It only occurred with git tag -s
, not with gpg
(e.g. gpg --clearsign
) itself.
The sole change necessary to get it working again in this case was to add export GPG_TTY=$(tty)
to my shell startup files.
I though didn't get the “Inappropriate ioctl for device” error message mentioned as indicator for this fix in another answer to this question.
Note: Since the cause for getting this error was a completely different one than for those who suggested export GPG_TTY=$(tty)
before (usually as a side hint) in other answers to this question, I decided this question needs another answer which mentions that export GPG_TTY=$(tty)
may be the main fix and sole thing necessary in some cases.