【发布时间】:2019-12-28 09:00:54
【问题描述】:
我最近尝试了适用于 Linux 的 Windows 子系统,当我尝试使用它喷出的最近生成的 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 的其他问题,最后都说了同样的话,设置全局变量。 有什么我忘记或弄错了吗?谢谢。
【问题讨论】:
标签: git github gnupg windows-subsystem-for-linux