git 错误:找不到与指定用户 ID 匹配的身份

Sof*_*ent 5 git github gpg-signature

因此,我只是花了很长时间遵循 git 说明,了解如何生成 gpg 密钥并签署我的提交,以便它们出现在我的帐户中。按照一切进行操作,顺利完成最后的步骤:

git config --global user.signingkey 70DA..(my key)
git config --global commit.gpgsign true
Run Code Online (Sandbox Code Playgroud)

但是,当我最终去:

git add .
git commit -S -m "whatever message"
Run Code Online (Sandbox Code Playgroud)

我收到这三个错误:

could not find identity matching specified user-id: 70DA..(my key)
error: gpg failed to sign the data
fatal: failed to write commit object
Run Code Online (Sandbox Code Playgroud)

我在其他帖子中看到了最后两个错误,但没有看到有关指定用户 ID 的错误。有谁知道如何解决这个问题或知道一些验证我的提交的捷径?我觉得花 2 个小时做这件事实在是太愚蠢了,我有点尴尬。

小智 2

检查中的电子邮件地址和用户 ID 是否.gitconfig与您的 gpg 密钥中的相同,并确保gpg.format未设置。请参阅/sf/answers/4265756071/