Tested on Mojave (10.14)
-
Install gnupg and the mac integration
brew install pinentry-mac brew install gpg
-
Configure gpg to use pinentry-mac
which pinentry-mac vim ~/.gnupg/gpg-agent.conf
Add this to
gpg-agent.conf
and save itpinentry-program /usr/local/bin/pinentry-mac
-
Restart gpg-agent
gpgconf --kill gpg-agent
-
Get your key ID (3AA5C...BD2 in this example)
$ gpg --list-secret-keys --keyid-format LONG /Users/hubot/.gnupg/secring.gpg ------------------------------------ sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10] uid Hubot ssb 4096R/42B317FD4BA89E7A 2016-03-10
-
Tell git about it
git config --global user.signingkey 3AA5C34371567BD2
-
Sign commits with your key
git commit -S -m your commit message
-
Setup autosign if so desired
git config commit.gpgsign true
Try the following:
- Restart to get pinentry-mac to work
- Set your git username/email to be the one used in the key