github桌面上gpg问题的解决办法?

问题描述 投票:0回答:1

我看到几个用户在使用 github dektop 签名时遇到问题,我遇到了这两个错误

gpg: error running '/usr/lib/gnupg/keyboxd': probably not installed
gpg: failed to start keyboxd '/usr/lib/gnupg/keyboxd': Configuration error
gpg: can't connect to the keyboxd: Configuration error
gpg: error opening key DB: No Keybox daemon running
gpg: skipped "your key": Input/output error
gpg: signing failed: Input/output error
error: gpg failed to sign the data
fatal: failed to write commit object

gpg: skipped "your key": Input/output error
gpg: signing failed: Input/output error
error: gpg failed to sign the data
fatal: failed to write commit object

我的gpg版本是2.4.4,github桌面版本是3.4.1

windows git gnupg github-desktop gpg-agent
1个回答
0
投票

所以我正在寻找这个问题的解决方案,并且我找到了一系列设法解决这个问题的步骤,应该注意的是,我使用的是Windows 11

首先你必须正确配置所有内容,如果你仍然遇到这些问题,你可以尝试这个方法

[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true
[user]
    name = user
    email = [email protected]
    signingkey = your key
[log]
    showSignature = true
[commit]
    gpsign = true
    gpgsign = true
[gpg]
    program = C:/Program Files/Git/usr/bin/gpg
[tag]
    gpgsign = true

当我打开笔记本电脑时,这就是我一直拥有的配置。我在一份出版物中读到,git 有自己的 gpg,并且如果它不应该是我们安装 gpg 的路径,那么它的路径就不是“正确的”路径。稍后我会详细解释这一点以及为什么我在引号中加上正确的内容。

我做的第一件事就是在 gpg-agent.conf 中写入这两行:

enable-ssh-support
allow-loopback-pinentry

然后在 gpg.conf 中我有以下几行:

no-tty
use-agent
pinentry-mode loopbackno-tyy
no-tty

行:pinentry-mode Loopbackno-tyy 那么它会影响但不用担心,对于我遵循的过程来说这是正常的

此后,我在 git bash 终端中执行的第一行如下:

git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe"

正如我之前提到的,我在一份出版物中读到,git 有 gpg 的默认路由,但是在安装它时还会创建另一个路由,如果这不是您安装 git 的路由,您将不得不寻找它位于哪里

在此之后,我写了以下行:

gpg --versión

现在只是想知道 gpg 版本:

echo "test" | gpg --clearsign

当您重写该行并对 pinentry-mode 进行评论时,应该会加载一个窗口,并出现一个窗口来写入您在创建密钥时选择的密码。

您必须输入密码,然后将生成类似于导出密钥以添加到 Github 时的文本。

然后你将写下以下内容:

export GPG_TTY=$(tty)

什么也不会发生,然后你将再次编写以下行:

echo "test" | gpg --clearsign

此时它不会要求您输入密码,它只会再次向您显示所有文本

现在,您将写下以下内容:

git config -l | grep gpg

它会向您显示一些像这样的行:

commit.gpgsign=true
gpg.program=C:/Program Files/Git/usr/bin/gpg
tag.gpgsign=true

最后你将写下以下内容:

git config --global gpg.program "$(which gpg)"

它要做的就是将 gpg 位置放回一开始的位置,即使用 git 位置,这就是为什么我在引号中提到“正确”,因为通过执行所有这些操作,您可以清理密钥,以便 github dektop 认为它是正确的位置,或者我会如何解释它。之后你可以编写你的提交并推送它。

希望对您有用!

注意:每次打开笔记本电脑时我都会遵循以下步骤

© www.soinside.com 2019 - 2024. All rights reserved.