Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git signed commits - How to suppress "You need a passphrase to unlock the secret key..."

Tags:

I changed my global Git configuration to sign all commits. I also use gpg-agent so that I don't have to type my password every time.

Now every time I make a new commit I see the following five lines printed to my console:

[blank line] You need a passphrase to unlock the secret key for user: "John Doe <[email protected]>" 2048-bit RSA key, ID ABCDEF12, created 2016-01-01 [blank line] 

Even worse, when I do a simple stash, this message is printed twice, needlessly filling my console (I assume for one for each of the two commit objects that are created).

Is there a way to suppress this output?

like image 223
friederbluemle Avatar asked Jun 11 '16 11:06

friederbluemle


People also ask

How do I find my GPG passphrase key?

Open the terminal application. Get a list of GPG keys by running the gpg --list-keys command. Run gpg --edit-key your-key-id command. At the gpg> prompt enter the passwd to change the passphrase.


1 Answers

This is more a gpg configuration issue than a git one.

Since you are using an agent, you could as a workaround add no-tty to your gpg.conf.

echo 'no-tty' >> ~/.gnupg/gpg.conf 

(this seems working even better than the --batch option)

like image 119
VonC Avatar answered Oct 05 '22 01:10

VonC