所以看起来我的 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