Git commit failing always due to GPG error

I am seeing below error every time I commit in git.

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

But, if I edit the expiration date of the key using gpg2 --edit-key B2C093EFB44F5C8A078439288C205B1C93FFBAF7 I am able to commit successfully. The problem is I need to update the expiry date always before doing a commit. Is there a way we can avoid changing the expiry date and permanently make not complain about gpg error?

I'm using Ubuntu 18.04 with Zsh.

Read more here:

Content Attribution

This content was originally published by Sarath S Nair at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: