gpt4 book ai didi

Git 不认为 gpg key 是 secret ,即使它是,我该如何修复它?

转载 作者:行者123 更新时间:2023-12-04 02:50:57 26 4
gpt4 key购买 nike

所以看起来我的 gpg key 是 secret 的,但是当我尝试在 git 中签署我的提交时,它不被识别为 secret 。我完全不知道为什么会这样。我相信我的设置正确,但我的提交标志失败。难道我做错了什么?在此先感谢您的帮助。

[brad@reason entry-criteria-test]$ gpg --list-secret-keys --keyid-format LONG
/home/brad/.gnupg/secring.gpg
-----------------------------
sec 4096R/15980D34B4EED3FA 2019-03-11
uid Brad <brad@work.com>
ssb 4096R/3B437BF0F7366F6C 2019-03-11

[brad@reason entry-criteria-test]$ git config user.signingkey 15980D34B4EED3FA
[brad@reason entry-criteria-test]$ git config --global user.signingkey 15980D34B4EED3FA
[brad@reason entry-criteria-test]$ git commit -S -m "testing signed commit"
gpg: key B4EED3FA: secret key without public key - skipped
gpg: skipped "15980D34B4EED3FA": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
[brad@reason entry-criteria-test]$ git config -l
user.name=Brad
user.email=brad@work.com
user.signingkey=15980D34B4EED3FA
color.ui=true
push.default=simple
commit.gpgsign=true
gpg.program=gpg2
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@github.work.com:entry-criteria-test.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.issue-00142.remote=origin
branch.issue-00142.merge=refs/heads/issue-00142
branch.issue-00144.remote=origin
branch.issue-00144.merge=refs/heads/issue-00144
commit.gpgsign=true
user.signingkey=15980D34B4EED3FA

最佳答案

问题出在:

gpg.program=gpg2

即使我安装了 gpg 2.2.13,git 仍然想使用 gpg。这是有道理的,因为我上面用于 gnupg 的所有命令都使用 gpg 而不是 gpg2。因此,如果您遇到此问题,请检查您的 gpg2 和 gpg key 是否不同。
gpg --list-secret-keys --keyid-format LONG
gpg2 --list-secret-keys --keyid-format LONG
git config -l

这些有区别吗?来自正确 gpg 的正确键是否与您的 git 配置匹配?

关于Git 不认为 gpg key 是 secret ,即使它是,我该如何修复它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55111685/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com