brew install gpgbrew install pinentry-macFollow instructions, select default via Enter if unsure. Make sure to use the same email and name as your GitHub account.
git config --global user.email #your-email"
git config --global user.name #your-name"And use same email and name in the key generation process:
gpg --full-generate-keygpg --list-secret-keys --keyid-format=longYour is in "sec" part after slash, eg: sec ed25519/HERE 2021-12-07 [SC]
which brewSubstitute all /usr/local/bin locations in the paths below to: /opt/homebrew/bin/brew.
git config --global user.signingkey <key>
git config --global commit.gpgsign true
git config --global gpg.program /opt/homebrew/bin/brew/gpgAdditional config
if [ -r ~/.zshrc ]; then echo 'export GPG_TTY=$(tty)' >> ~/.zshrc; \
else echo 'export GPG_TTY=$(tty)' >> ~/.zprofile; fiAdd pinentry-mac to gpg-agent.conf by first checking where it is located and substituting it in the path below:
which pinentry-macecho "pinentry-program /opt/homebrew/bin/pinentry-mac" > ~/.gnupg/gpg-agent.confgpgconf --kill gpg-agentOutput your public key:
gpg --armor --export <key><https://github.com/settings/gpg/new>After a mac update sometimes the pinentry-mac is set back to it's original state in the gpg config:
vim ~/.gnupg/gpg-agent.confThe line should state:
pinentry-program /opt/homebrew/bin/pinentry-macinstead of this
pinentry-program /usr/local/bin/pinentry-macafter editing this is required:
gpgconf --kill gpg-agent