Instructions up to date as of March 2022. Assumes homebrew and git are installed on your machine.
- Install GPG
brew install pinentry-macbrew install gnupg
- Follow these instructions to generate a new key
- Follow these instructions add the key to your github account
- Configure git to use gpg
git config --global commit.gpgsign truegit config --global user.signingkey YOUR_KEY_IDYOUR KEY ID can be found withgpg --list-secret-keysand will havesecnear it. The key id will look likeA7BCA42713CC5EA8E550B0C23461962218665F54git config --global gpg.program gpg
- Add the following to
~/.gnupg/gpg-agent.confpinentry-program /opt/homebrew/bin/pinentry-mac# This is the path to the pinentry-mac, can can be found withwhich pinentry-mac. I used my value for the example.default-cache-ttl 604800
- Add the following to
~/.gnupg/gpg.confuse-agentdefault-key A7BCA42713CC5EA8E550B0C23461962218665F54(Same key as your key from step 4.2)