-
-
Save cezaraugusto/2c91d141ddec026753051ffcace3f1f2 to your computer and use it in GitHub Desktop.
For troubleshooting, two things to first try: | |
run `git config --global gpg.program gpg2`, to make sure git uses gpg2 and not gpg | |
run `echo "test" | gpg2 --clearsign`, to make sure gpg2 itself is working | |
If that all looks all right, one next thing to try: | |
run `brew install pinentry` to ensure you have a good tool installed for passphrase entry | |
If after that install and you re-try git commit and still get the "failed to sign the data" error: | |
run `gpgconf --kill gpg-agent` to kill any running agent that might be hung | |
If that says gpgconf isn’t installed or doesn’t have a `--kill` option, you might try this: | |
`cp ~/.gnupg ~/.gnupg-GOOD` to save a copy of your `~/.gnupg` to revert to later if needed | |
`brew install gnupg21` to install `GnuPG 2.1` | |
The reason for saving a copy of your `~/.gnupg` dir is that GnuPG 2.1 potentially creates/changes some key data in way that isn’t backward-compatible with GnuPG 2.0 and earlier, so if you want to go back later, you can do `mv ~/.gnupg ~/.gnupg21 && mv ~/.gnupg-GOOD ~/.gnupg`. | |
Otherwise there are some basic steps to run to check you’ve got a working GnuPG environment: | |
run `gpg2 -K --keyid-format SHORT`, to check that you have at least one key pair | |
If the output of that shows you have no secret key for GnuPG to use, then you need to create one: | |
run `gpg2 --gen-key`, to have GnuPG walk you through the steps for creating a key pair | |
source: https://stackoverflow.com/a/41054093/4902448 |
need to change from 'brew install gnupg21' to 'brew install gnupg2'
QFT
run
gpgconf --kill gpg-agent
to kill any running agent that might be hung
In my case (zsh on MacOS Catalina), all I needed to do to fix this was add to this to my .zshrc: export GPG_TTY=$(tty)
.
In my case (zsh on MacOS Catalina), all I needed to do to fix this was add to this to my .zshrc:
export GPG_TTY=$(tty)
.
This solved my problem as well.
Thanks for the tip.
Thanks @Shosta. It solved me
This (the gpgconf --kill gpg-agent
command) worked for me. Thank you.
In my case (zsh on MacOS Catalina), all I needed to do to fix this was add to this to my .zshrc:
export GPG_TTY=$(tty)
.
Thanks this fixed for me as well.
Hey Thanks orome your suggested fix
worked out Gr8 for me too
:-)
Great concise walk-through, quickfix solved it on ubuntu 18.04
In my case (zsh on MacOS Catalina), all I needed to do to fix this was add to this to my .zshrc:
export GPG_TTY=$(tty)
.
- Thanks this fixed. 🔥
to add, if it helps somebody don't forget to restart the thermian lol
gpgconf --kill gpg-agent
was what worked for me
gpgconf --kill gpg-agent
Worked!
gpg --list-keys
git config --global user.signingkey [my pub hash key]
worked for me
gpgconf --kill gpg-agent
worked for me after upgrading to big sur
Thank you for this. I'm a returning Mac user and this was causing me some headaches after the Big Sur upgrade.
In my case (zsh on MacOS Catalina), all I needed to do to fix this was add to this to my .zshrc:
export GPG_TTY=$(tty)
.
- Thanks this fixed. 🔥
to add, if it helps somebody don't forget to restart the thermian lol
worked for me. My mac OS Big Sur.
Thanks all
I upgraded brew and I got
gpg: signing failed: No pinentry
gpg: [stdin]: clear-sign failed: No pinentry
gpgconf --kill gpg-agent
worked for me too. Thanks for the tips!
killed gpg agent and also exported that env var. Still no joy...
In my case (zsh on MacOS Catalina), all I needed to do to fix this was add to this to my .zshrc:
export GPG_TTY=$(tty)
.
- Thanks this fixed. 🔥
to add, if it helps somebody don't forget to restart the thermian lol
This works!
export GPG_TTY=$(tty)
then source ~/.zshrc
stack overflow thread has nothing on this gist!!!
In Debian 10, worked out well:
export GPG_TTY=$(tty)
source ~/.bashrc
the gpgconf --kill gpg-agent command
saved my day Thank you!!!!.
for me, remove the gpgsign: true
in git config --global -e
works, lol
Thank you! It worked for me.
Non of these worked for me on macos, I needed to install pinentry-mac
instead of pinentry
By running brew install pinentry-mac
Non of these worked for me on macos, I needed to install
pinentry-mac
instead ofpinentry
By runningbrew install pinentry-mac
This is what helped. For some reason, killing gpg-agent
is no longer sufficient.
Thanks @grgmgd!
i highly suggest this gist , everything goes well now