Git在Windows操作系统中找不到我的gpg2文件或目录
因此,我正在尝试签署我的提交,以便最终能够发送对所做更改的合并请求。 它需要一个gpg密钥,所以我下载了Gpg4Win并使用Kleopatra生成了我需要的公共gpg密钥,并将其链接到我的GitLab。所有需要的正常步骤。 我将git配置为我的密钥,如下所示:Git在Windows操作系统中找不到我的gpg2文件或目录,windows,git,gitlab,gnupg,Windows,Git,Gitlab,Gnupg,因此,我正在尝试签署我的提交,以便最终能够发送对所做更改的合并请求。 它需要一个gpg密钥,所以我下载了Gpg4Win并使用Kleopatra生成了我需要的公共gpg密钥,并将其链接到我的GitLab。所有需要的正常步骤。 我将git配置为我的密钥,如下所示: git config --global user.signingkey 0B613778C578 然后尝试提交,使用新密钥签名: git commit -S -m "Google Tag Manager installed onto 4
git config --global user.signingkey 0B613778C578
然后尝试提交,使用新密钥签名:
git commit -S -m "Google Tag Manager installed onto 404 error page"
其中我收到以下错误:
gpg: skipped "0B613778C578": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
error: cannot spawn gpg2: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
GitLab建议在收到此消息时使用以下命令:
git config --global gpg.program gpg2
但这会产生以下错误:
gpg: skipped "0B613778C578": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
error: cannot spawn gpg2: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
这基本上就是我所处的位置。我现在知道了如何让git正确地指向我的gpg
这是我安装的gpg版本:
gpg(GnuPG)2.2.19
非常感谢您的帮助