Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jinzaizhichi/368bc6bbfe5c9e74286277972c607ce3 to your computer and use it in GitHub Desktop.

Select an option

Save jinzaizhichi/368bc6bbfe5c9e74286277972c607ce3 to your computer and use it in GitHub Desktop.
FIX - gpg failed to sign the data fatal: failed to write commit object

FIX - gpg failed to sign the data fatal: failed to write commit object

!!! For M1/M2 apple silicon see this comment:

https://gist.github.com/Peredery/38d0538dd34381bbd9d13414269a1f27?permalink_comment_id=4559612#gistcomment-4559612

For MacOS | Mojave | High Sierra

Step 1 - Upgrade current gpg

brew upgrade gnupg

Step 2 - Install pinentry-mac

brew install pinentry-mac 

Step 3 - Update gpg-agent.conf

echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf 

Step 4 - Restart gpg-agent

killall gpg-agent && gpg-agent --daemon

Step 5 - Configure git to use GPG

git config --global gpg.program gpg
git config --global commit.gpgsign true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment