本文介绍了Git签名提交 - 如何取消“您需要密码才能解锁密钥......”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更改了我的全局Git配置以签署所有提交。我也使用gpg-agent,这样我就不必每次输入密码。

现在每次我做一个新的提交时,我都会看到下面五行到我的控制台:

  code>添加到 gpg.conf 中。  

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

(这似乎是工作甚至比 - 批次选项更好)


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 <mail@gmail.com>"
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?

解决方案

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)

这篇关于Git签名提交 - 如何取消“您需要密码才能解锁密钥......”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 17:19
查看更多