Git commit signing

I’ve been trying to set up git commit signing, and was treated with the following error:

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

Digging deeper I found out that git wasn’t able to match my GPG key to my email. I still don’t know why exactly this happened, since the email is the same, but I suspect it’s due to me having multiple GPG keys (albeit for different emails).

Anyway the fix for this problem is telling git to use a specific key:

git config user.signingkey <youremail@example.com>

This should work with key-ids too, but I prefer having a readable email in there.

comments powered by Disqus