SA
메인 내용으로 이동

Resolving GPG Fail to Sign Error

If you get...

git commit -m "add yarn.lock"
error: gpg failed to sign the data
fatal: failed to write commit object

Then...

brew upgrade gnupg
brew link --overwrite gnupg
brew install pinentry-mac
which pinentry-mac

Put the path into the gpg-agent.conf file. If there is no gpg-agent.conf file found in the ~/.gnupg/ directory, create one.

touch ~/.gnupg/gpg-agent.conf
echo "test" | gpg --clearsign
git config --global gpg.program gpg
git config --global commit.gpgsign true
git log --show-signature -1
gpgconf --kill gpg-agent

Make sure you didn't delete ~.gnupg.

Reference

이 문서를 언급한 문서들