我最近尝试使用Windows子系统来运行Linux,当我试图用最近生成的GPG密钥签署git提交时,它显示如下:
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ git commit -S -m "gpg signing"
error: gpg failed to sign the data
fatal: failed to write commit object
我使用git已经有一段时间了,知道必须在git上设置本地或全局变量才能使用我的GPG密钥。
第一次出错后,我尝试生成另一个密钥,但是也没有成功,包括子密钥。
我的GPG加密采用RSA和RSA(默认)。
我尝试使用help.github.com上的文章,但没有成功。
(以下是一些具体来源。) https://help.github.com/en/articles/telling-git-about-your-signing-key
https://help.github.com/en/articles/signing-commits
以下是终端日志的大部分内容
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ git config --global commit.gpgsign true
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ gpg2 --list-secret-keys --keyid-format LONG
gpg: checking the trustdb
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u
gpg: next trustdb check due at 2021-08-22
/home/verticalfile30/.gnupg/pubring.kbx
---------------------------------------
sec rsa4096/498F47808959B459 2019-08-23 [SC] [expires: 2021-08-22]
A533C851D2905FC63C161831498F47808959B459
uid [ultimate] Vert Simon (Key#3) <stopmotion45c@gmail.com>
ssb rsa4096/E4E65BE559FFBE2C 2019-08-23 [E] [expires: 2021-08-22]
sec rsa4096/B3C88EE54DC15CC9 2019-08-23 [SC]
87F5399E6BFEF88C1C64794CB3C88EE54DC15CC9
uid [ultimate] Vert S (Sop) <stopmotion45c@gmail.com>
ssb rsa4096/E868623210106F9D 2019-08-23 [E]
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ git config --global user.signingkey E868623210106F9D
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ git commit -S -m "gpg signing"
error: gpg failed to sign the data
fatal: failed to write commit object
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ git config --global user.signingkey B3C88EE54DC15CC9
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ git commit -S -m "gpg signing"
error: gpg failed to sign the data
fatal: failed to write commit object
许多在线资源以及Stack Overflow上的其他问题最终都会说同样的话,即设置全局变量。我是否忘记了什么或者出了什么问题?谢谢。