You are not logged in.

#1 2021-02-01 17:30:36

now-im
Member
Registered: 2018-02-14
Posts: 19

[Solved] Can't Git Sign Commits

Whenever I try to git sign a commit, I get this error.

git commit -m "message"
error: gpg failed to sign the data
fatal: failed to write commit object

I have tried the following methods to solve this.

1. As I use Zsh and Oh-My-Zsh, I enable gpg-agent plugin.
2. Tried to add this on my shell config export GPG_TTY=$(tty).
3. Edited the ~/.gnupg/gpg-agent.conf to set pinentry-program as pinentry-program /usr/bin/pinentry-curses

I have turned the internet upside down, but I can't seem to solve the problem. Kindly help!

Last edited by now-im (2021-03-20 14:17:06)

Offline

#2 2021-02-01 17:36:03

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Can't Git Sign Commits

Get rid of oh-my-zsh completely and try again.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-02-01 17:48:20

now-im
Member
Registered: 2018-02-14
Posts: 19

Re: [Solved] Can't Git Sign Commits

Slithery wrote:

Get rid of oh-my-zsh completely and try again.

Completely removed oh-my-zsh and config file. Still same result.

Offline

#4 2021-03-20 14:13:28

now-im
Member
Registered: 2018-02-14
Posts: 19

Re: [Solved] Can't Git Sign Commits

I have solved it myself. Completely Removed folder:

~/.gnupg

After that generated a new GPG key and that somehow solved the problem.

Last edited by now-im (2021-03-20 14:18:56)

Offline

#5 2022-07-07 09:55:45

alexander.gonquin
Member
Registered: 2022-07-07
Posts: 1

Re: [Solved] Can't Git Sign Commits

I had the same problem which was caused by trying to sign with an expired key.
After renewing the expiration date the problem disappeared.

Offline

Board footer

Powered by FluxBB