See: https://github.com/microsoft/vscode/wiki/Commit-Signing
brew install gpg2 gnupg pinentry-mac
mkdir -p ~/.gnupg
echo "pinentry-program $(brew --prefix)/bin/pinentry-mac"
echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
echo "use-agent" >> ~/.gnupg/gpg.conf
echo 'export GPG_TTY=$(tty)' >> ~/.zprofile
gpg --full-generate-key
(1) RSA and RSA
What keysize do you want? (3072) 4096
Key is valid for? (0)
Is this correct? (y/N) y
Real name:
Email address:
Comment:
---
gpg --armor --export <id>
git config --global user.signingkey <id>
git config --global commit.gpgsign true