brew install gpg pinentry-mac
Because pinentry-mac didn't work for me, I replaced the default pinentry app with the following:
rm /usr/local/opt/pinentry/bin/pinentry
ln -s /usr/local/bin/pinentry-mac /usr/local/opt/pinentry/bin/pinentry
export GPG_TTY=$(tty)
[commit]
gpgsign = true
# This is probably not necessary and should really be run with
# git config --global gpg.program $(which gpg)
[gpg]
program = /usr/local/bin/gpg
gpg --full-generate-key
# From the option chose, option 1, RSA RSA
# Set key size 4096
# Also be sure to set an expiration date for like a 1year
gpg --armor --export <your-email> | pbcopy