I have recently tried the Windows Subsystem for Linux lately and as I was attempting to sign my git commits with a recently generated GPG key it spewed out,
verticalfile30@DESKTOP-U284V9I:~/cpo/wsltest$ git commit -S -m "gpg signing"
error: gpg failed to sign the data
fatal: failed to write commit object
I have used git long enough to know that I have to set the local or global variables on git to use my GPG key.
After the first error, I tried to generate another key but that also did not work, including the subkeys.
My GPGs were encrypted in RSA and RSA (default).
I have tried using articles on help.github.com but to no avail.
(Here are some specific sources.) https://help.github.com/en/articles/telling-git-about-your-signing-key
https://help.github.com/en/articles/signing-commits
Here is most of the terminal log
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) <[email protected]>
ssb rsa4096/E4E65BE559FFBE2C 2019-08-23 [E] [expires: 2021-08-22]
sec rsa4096/B3C88EE54DC15CC9 2019-08-23 [SC]
87F5399E6BFEF88C1C64794CB3C88EE54DC15CC9
uid [ultimate] Vert S (Sop) <[email protected]>
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
Many sources online, as well as other questions on Stack Overflow, ended up saying the same thing, set the global variables. Is there something I am forgetting or getting wrong? Thanks.