For some reason my git commits failed when I re-enabled gpg signing. This is how I finally fixed that problem.

Add to ~/.gnupg/gpg.conf
1use-agent 
2pinentry-mode loopback
And add to ~/.gnupg/gpg-agent.conf
1allow-loopback-pinentry
Restart the agent
1$ echo RELOADAGENT | gpg-connect-agent

This information was found on d.sb/2016/11/gpg-inappropriate-ioctl-for-device-errors.