Docs feedback: Signing commits with GPG `gpg failed to sign the data` error
https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/
The following error happens when you try to sign your commit from the terminal (tested on macOs Mojave, but could be the case of for other OS as well). When you do a git commit, a dialog should appear asking you to enter your gpg password. If the environment variable GPG_TTY
is not set, the dialog fails to show and the following error occurs.
error: gpg failed to sign the data
fatal: failed to write commit object
Tell how to fix the above error (if it occurs)
I was able to fix this issue following this link https://juliansimioni.com/blog/troubleshooting-gpg-git-commit-signing/
and setting the environment variable using this command:
GPG_TTY=$(tty)
export GPG_TTY
Edited by L Mendes