nguyenvulong / QA

The Unlicense
0 stars 0 forks source link

[git] error - gpg failed to sign data #65

Open nguyenvulong opened 1 year ago

nguyenvulong commented 1 year ago

This is for secure signing, when you are doing something like

git commit -S -m "message"

Solution

first make sure you have register your signing key git config --global user.signingkey YOUR_KEY where YOUR_KEY can be retrieved by gpg --list-secret-keys --keyid-format=long

then try to reload the agent echo RELOADAGENT | gpg-connect-agent

then re-commit. If you still get the error then kill the agent and launch it again gpgconf --kill gpg-agent gpgconf --launch gpg-agent

and may be reload it one more time echo RELOADAGENT | gpg-connect-agent

finally export GPG_TTY=$(tty)

If it does not work for you, check https://stackoverflow.com/questions/41052538/git-error-gpg-failed-to-sign-data