When I do git commit -a -S -m "Commit Message"
, I get this error:
You need a passphrase to unlock the secret key for user: "Username (Gpg Key) <email-id>" 2048-bit RSA key, ID 2487BE7C, created 2016-10-03 error: gpg failed to sign the data fatal: failed to write commit object
But, it doesn't even ask/prompts for my passphrase when I commit. So, how and where do I enter my passphrase while using gpg's -S
flag?
The passphrase itself is not stored anywhere and thus cannot be displayed. The decryption process works anyway by repeatedly applying a secure hash algorithm to a concatenation of the passphrase being input and a salt value (a random number) read from the key ring.
About GPG keys GPG is a command line tool used together with Git to encrypt and sign commits or tags to verify contributions in Bitbucket. In order to use GPG keys with Bitbucket, you'll need generate a GPG key locally, add it to your Bitbucket account, and also set it up for use with Git.
I had the similar thing. I had the gpg and gpg2 binaries, both pointing to GPG version 2.0.30. I wasn't being prompted for my passphrase.
In your bash profile (I did it in my .zshrc file) add the following line:
export GPG_TTY=$(tty)
It stopped prompting me, so I had to kill the daemon
ps aux | grep gpg mark 3129 0.0 0.0 4397952 820 ?? Ss 8Mar19 0:28.84 gpg-agent --homedir /Users/Mark/.gnupg --use-standard-socket --daemon mark 18137 0.0 0.0 4286492 848 s000 R+ 3:43pm 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn gpg
then
sudo kill -9 3129
Then it worked. It may be a slightly different issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With