I installed GPG from brew.
brew install gpg
It is gnupg2-2.0.30_2.
When I commit, I do get a error message:
You nee
To anybody who is facing this issue on MacOS machines, try this:
brew uninstall gpg
brew install gpg2
brew install pinentry-mac
(if needed)gpg --full-generate-key
Create a key by using an algorithm.gpg --list-keys
git config --global user.signingkey <Key from your list>
git config --global gpg.program /usr/local/bin/gpg
git config --global commit.gpgsign true
gpg --armor --export <key>
and add this key to GitHub at GPG keys: https://github.com/settings/keys (with START and END line included)If the issue still exists:
test -r ~/.bash_profile && echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile
echo 'export GPG_TTY=$(tty)' >> ~/.profile
If the issue still exists:
Install https://gpgtools.org and sign the key that you used by pressing Sign from the menu bar: Key->Sign
If the issue still exists:
Go to: your global .gitconfig
file which in my case is at: /Users/gent/.gitconfig
And modify the .gitconfig file (please make sure Email and Name are the same with the one that you have created while generating the Key):
[user]
email = gent@youremail.com
name = Gent
signingkey = <YOURKEY>
[gpg]
program = /usr/local/bin/gpg
[commit]
gpsign = true
gpgsign = true
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[credential]
helper = osxkeychain
p.s I took this answer from my previous answer here: gpg failed to sign the data fatal: failed to write commit object [Git 2.10.0]