No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
- Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
- Create or import a key -- see below for https://keybase.io
- Run
gpg --list-secret-keys
and look forsec
, use the key ID for the next step - Configure
git
to use GPG -- replace the key with the one fromgpg --list-secret-keys
git config --global gpg.program /usr/local/MacGPG2/bin/gpg2
git config --global user.signingkey A6B167E1
git config --global commit.gpgsign true
- Optionally configure annotated tags to be GPG signed
git config --global tag.forceSignAnnotated true
- Add this line to
~/.gnupg/gpg-agent.conf
pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
- Add this line to
~/.gnupg/gpg.conf
no-tty
% keybase pgp export
% keybase pgp export -q CB86A866E870EE00 | gpg --import
% keybase pgp export -q CB86A866E870EE00 --secret | gpg --allow-secret-key-import --import
% open https://github.com/settings/keys
% keybase pgp export -q CB86A866E440EE00 | pbcopy
- https://github.com/pstadler/keybase-gpg-github
/usr/local/MacGPG2
-- this is where MacGPG binaries live- https://gpgtools.org
- https://www.git-tower.com
Because it’s not guaranteed to be there (it not on my set up, for example).
/usr/local/MacGPG2/bin/gpg2
is guaranteed, because it’s in the GPG Suite app bundle which this whole Gist is centered around.Only if
/usr/local/MacGPG2/bin
is in your search path (tryecho $PATH
in the Terminal) and there is no othergpg
under an earlier search path. The GPG Suite installer seems to append the search path. But in Max’ and my case, it fails due to anothergpg
being installed as well (/usr/local/bin/
in my case).By using the fully qualified executable path, it just works.