Instructions up to date as of March 2022. Assumes homebrew and git are installed on your machine.
- Install GPG
brew install pinentry-mac
brew 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 true
git config --global user.signingkey YOUR_KEY_ID
YOUR KEY ID can be found withgpg --list-secret-keys
and will havesec
near it. The key id will look likeA7BCA42713CC5EA8E550B0C23461962218665F54
git config --global gpg.program gpg
- Add the following to
~/.gnupg/gpg-agent.conf
pinentry-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.conf
use-agent
default-key A7BCA42713CC5EA8E550B0C23461962218665F54
(Same key as your key from step 4.2)