首页 > 解决方案 > 在 Windows 上使用 Git 的 GPG 代理上的 IPC 错误

问题描述

我想在 Windows 上使用没有安装 Gpg4win 的 GPG,因为Git for Windows包含我们很好的 GPG 二进制文件,所以我想使用它而不是安装额外的应用程序。

但是,当我设置 GPG(例如添加路径等)时,我遇到了以下错误:

C:\Users\me> gpgconf --launch gpg-agent
gpgconf: error running '/usr/bin/gpg-connect-agent': exit status 1
gpgconf: error running '/usr/bin/gpg-connect-agent NOP': General error

并与gpg-connect-agent

C:\Users\me> gpg-connect-agent /bye
gpg-connect-agent: no running gpg-agent - starting '/usr/bin/gpg-agent'
gpg-connect-agent: waiting for the agent to come up ... (5s)
gpg-connect-agent: waiting for the agent to come up ... (4s)
gpg-connect-agent: waiting for the agent to come up ... (3s)
gpg-connect-agent: waiting for the agent to come up ... (2s)
gpg-connect-agent: waiting for the agent to come up ... (1s)
gpg-connect-agent: can't connect to the agent: IPC connect call failed
gpg-connect-agent: error sending standard options: No agent running

我需要运行代理才能签署 git 提交,所以我不确定发生了什么。

在此错误发生之前,我使用的是 Gpg4win,它完全没有错误(为了确保它不是版本问题,我已经删除了 中的所有内容%userprofile%/.gnupg

系统信息:

任何帮助,将不胜感激。谢谢

标签: windowsgitgit-bashgnupggpg-agent

解决方案


我在新的 MacOS(蒙特雷)上全新安装 gnupg2 时遇到了同样的问题。似乎安装不会创建.gnupg文件夹。

在我的情况下,这是通过运行解决的:

gpg -K

这导致创建了丢失的文件夹

gpg: directory '/Users/xxx/.gnupg' created 
gpg: keybox '/Users/xxx/.gnupg/pubring.kbx' created
gpg: /Users/xxx/.gnupg/trustdb.gpg: trustdb created

一切都很好。


推荐阅读