Problems with git commit autosigning on mac

0hlov3
Nov 1, 2021

--

Photo by Yancy Min / Unsplash

i have the Problem, that i get a error message sometimes, since i’ve enabled git gpgsign on mac.

Error message

sometime the gpg-agent stucks, so i get the error message:

❯ git commit -m 'Test'
error: gpg failed to sign the data
fatal: failed to write commit object

Quik fix

to quik fix this issue you can kill the gpg-agent.

pkill -9 gpg-agent && export GPG_TTY=$(tty)

General fix

add the fallowing lines to your bashrc.

GPG_TTY=$(tty)
export GPG_TTY

don’t trust me…

I do not know what I am doing, so I cannot take responsibility for the accuracy of the information provided here

--

--

0hlov3

Passionate DevOps engineer with a preference for Infrastructure as Code, Automation, Kubernetes, Go, Azure- and HetznerCloud.