小编Hay*_*umm的帖子

阻止 gpg 在我每次提交时询问密钥

本质上我想要的是不必每次在 git 中提交时都输入密码。

在寻找解决方案时我发现了这个

所以它告诉我在配置文件中设置 default-cache-ttl 和 max-cache-ttl 。但该文件似乎不在我的安装中的 C:\users<name>.gnupg 中。(我正在运行 Windows 10,根据 gpg --version,GPG 版本为 2.2.23)

接下来我发现这篇文章表明该文件将位于 %appdata%\gnupg 中,但该文件不存在。我尝试添加包含以下内容的文件:

default-cache-ttl 2592000
max-cache-ttl 2592000
Run Code Online (Sandbox Code Playgroud)

当我使用以下命令重新启动 gpg 时

gpgconf.exe --reload gpg-agent
gpgconf.exe --list-options gpg-agent
Run Code Online (Sandbox Code Playgroud)

它输出这个:

Monitor:1:0:Options controlling the diagnostic output:0:0::::
verbose:12:0:verbose:0:0::::
quiet:8:0:be somewhat more quiet:0:0::::
Configuration:1:0:Options controlling the configuration:0:0::::
disable-scdaemon:8:1:do not use the SCdaemon:0:0::::
enable-ssh-support:0:0:enable ssh support:0:0::::
ssh-fingerprint-digest:24:2:use ALGO to show ssh fingerprints:1:1:ALGO:"md5::
enable-putty-support:0:0:enable putty support:0:0::::
Debug:1:1:Options useful for debugging:0:0::::
debug-level:26:1:set the debugging level to LEVEL:1:1:LEVEL:"none::
log-file:8:1:write …
Run Code Online (Sandbox Code Playgroud)

windows git gnupg

6
推荐指数
1
解决办法
1775
查看次数

标签 统计

git ×1

gnupg ×1

windows ×1