【问题标题】:IPC Error on GPG Agent with Git on Windows在 Windows 上使用 Git 的 GPG 代理上的 IPC 错误
【发布时间】:2021-10-13 16:36:47
【问题描述】:

我想在 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 中的所有内容)

系统信息:

  • Windows 10 21H1 19043.1110

  • git version 2.29.2.windows.1

  • C:\Users\me> gpg --version
      gpg (GnuPG) 2.2.23-unknown
      libgcrypt 1.8.7
      Copyright (C) 2020 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
    
      Home: C:/Users/me/.gnupg
      Supported algorithms:
      Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
      Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
              CAMELLIA128, CAMELLIA192, CAMELLIA256
      Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
      Compression: Uncompressed, ZIP, ZLIB, BZIP2
    
  • where gpg:C:\Program Files\Git\usr\bin\gpg.exe

  • where git:C:\Program Files\Git\cmd\git.exe

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

【问题讨论】:

    标签: windows git git-bash gnupg gpg-agent


    【解决方案1】:

    我在新的 MacOS (Monterey) 上全新安装 gnupg2 时遇到了同样的问题。似乎安装没有创建.gnupg 文件夹。

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

    gpg -K

    这导致 missing 文件夹的创建

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

    一切都很好。

    【讨论】:

      【解决方案2】:

      我设法弄明白了。

      这是因为 git for windows 中的 gpg 使用 MINGW64 作为环境。并且因为我手动将GNUPGHOME环境变量设置为Windows路径:C:/users/me/.gnupg,所以不起作用。

      (我从不使用包含的MINGW64 git bash,我只使用cmd并将那些exe,如git,gpg 添加到PATH

      所以,如果您手动设置了GNUPGHOME 环境变量,则需要更改为MINGW64 路径。

      所以在我的情况下,C:/users/me/.gnupg -> /c/users/me/.gnupg

      我不确定--homedir

      【讨论】:

        猜你喜欢
        • 2018-04-10
        • 2017-05-21
        • 2015-05-31
        • 2011-11-23
        • 2015-11-22
        • 1970-01-01
        • 1970-01-01
        • 2018-03-22
        相关资源
        最近更新 更多