Jam*_*han 7 windows git gnupg git-bash gpg-agent
我想在 Windows 上不安装 Gpg4win 的情况下使用 GPG,因为Windows 版的 Git包含了 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
Run Code Online (Sandbox Code Playgroud)
与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
Run Code Online (Sandbox Code Playgroud)
我需要运行代理才能签署 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
Run Code Online (Sandbox Code Playgroud)
where gpg:C:\Program Files\Git\usr\bin\gpg.exe
where git:C:\Program Files\Git\cmd\git.exe
任何帮助,将不胜感激。谢谢
我在新的 MacOS (Monterey) 上全新安装 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
Run Code Online (Sandbox Code Playgroud)
一切都很好。
我设法弄清楚了。
这是因为git for windows中的gpg用于MINGW64环境。而且因为我手动将GNUPGHOME环境变量设置为Windows路径:C:/users/me/.gnupg,所以它不起作用。
(我从不使用附带的MINGW64git bash,我只使用 cmd 并将这些 exe,如 git、gpg 添加到PATH)
因此,如果您手动设置了GNUPGHOMEenv 变量,则需要更改为MINGW64路径。
所以就我而言,C:/users/me/.gnupg->/c/users/me/.gnupg
但我不确定--homedir。
| 归档时间: |
|
| 查看次数: |
3976 次 |
| 最近记录: |