Inappropriate Ioctl for Device GPG Error
July 9, 2024•117 words
Introduction
Are you trying to push or commit your code to Github/Git and when committing, notice that you're getting the error 'Inappropriate ioctl for device' error?
This is because you're using GPG (PGP) to sign your Git commits (hopefully this is intended as signing your commits allows your Git provider to know for certain a commit came from your machine).
Solution
This issue stems from a step being skipped when GPG support is enabled. According to the gpg-agent
man pages, you should always add export GPG_TTY=$(tty)
to your terminals initiation file. This is usually ~/.bashrc
or ~/.zshrc
.
Once you've added that line, if you try commit again, you'll find that the issue magically goes away!