看起来我的gpg密钥是保密的,但是当我试图在git中签署我的提交时,它没有被识别为保密的。我完全不知道这是为什么。我相信我已经正确地设置了这个,但我的提交签名失败了。我做错了什么吗?提前感谢任何帮助。
[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
git config --global gpg.program gpg2
解决了这个问题(尽管gpg
的输出与gpg2
的输出相匹配)。 - Izzygit config --global gpg.program gpg
命令,然后一切都重新开始正常工作了。 - Hiebs915