Install required software:
brew install gpg2 gnupg pinentry-mac
Configure it:
mkdir -m 700 ~/.gnupg
echo 'pinentry-program $(brew --prefix)/bin/pinentry-mac' > ~/.gnupg/gpg-agent.conf
echo 'use-agent' > ~/.gnupg/gpg.conf
Configure git:
git config --global gpg.program $(which gpg)
git config --global user.signingkey 1111111
git config --global commit.gpgsign true
Configure GnuPG to use keys.openpgp.org as keyserver, add this line to your gpg.conf file:
keyserver hkps://keys.openpgp.org
Refresh all your keys (e.g. new revocation certificates and subkeys):
gpg --refresh-keys
Upload your key
gpg --export [email protected] | curl -T - https://keys.openpgp.org
References: