nullpointer nullpointer - 3 months ago 95
Git Question

gpg failed to sign the data fatal: failed to write commit object [Git 2.10.0]

I followed few articles over the pretty attributes on Git 2.10 release note. Going through which upgraded the git to 2.10.0 and made changes to global

resulting as follows -

[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
name = xyz
email =
signingkey = AAAAAAA
excludesfile = /Users/xyz/.gitignore_global
editor = 'subl' --wait
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/ \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[color "diff"]
old = red strike
new = green italic

But now that I try to sign my commits using

git commit -a -S -m "message"

I get to see the following error -

You need a passphrase to unlock the secret key for

user: "XYZ (Digitally Signed) "

2048-bit RSA key, ID AAAAAAAA, created 2016-07-01

error: gpg failed to sign the data fatal: failed to write commit

Note - I can still commit changes using
git commit -a -m "message"

Is there a way to overcome the same? Or any change required in
configs to get along with the upgradation of git?

Update 1

Also seeking further usefulness, following Is there a way to "autosign" commits in Git with a GPG key?. I've already configured the key using

git config --global user.signingkey ED5CDE14(with my key)
git config --global commit.gpgsign true

and quite obviously getting the same error anyway.


If ran into this issue with OSX.

It seems like a gpg update (of brew) changed to location of gpg to gpg1, you can change the binary where git looks up the gpg:

git config --global gpg.program gpg1

See this medium blog post.