Run:
brew install gnupg pinentry-mac
git config --global user.signingkey <key>
git config --global commit.gpgsign true
git config --global gpg.program gpg
Then add the following line to ~/.gnupg/gpg-agent.conf
:
pinentry-program /usr/local/bin/pinentry-mac
or, if using the new Homebrew location:
pinentry-program /opt/homebrew/bin/pinentry-mac
Thanks for this useful Gist!
I wanted to mention that the first step can be shortened:
There is no longer a need to specify
gnupg2
because it has been renamed tognupg
, as documented here.I also found that this step is not strictly necessary:
If
gpg.program
is not specified, Git will usegpg
by default, as documented here.