Auto-sign commits on MacOS (Globally and with different IDEs):
Get your signingkey in this way.
$ brew install gnupg gnupg2 pinentry-mac
$ git config --global user.signingkey <YOUR_SIGNING_KEY>
$ git config --global commit.gpgsign true
$ git config --global gpg.program gpg
Put the following in gpg.conf
file (edit file with nano ~/.gnupg/gpg.conf
command):
no-tty
Put the following in gpg-agent.conf
file (edit file with nano ~/.gnupg/gpg-agent.conf
command):
pinentry-program /usr/local/bin/pinentry-mac
Credits go to: Shayan Amani https://stackoverflow.com/a/47087248