0

I cannot commit anything into my git repository anymore. I'm running Windows 11 and I'm trying to commit from VS Code version control panel. I'm just getting this:

gpg: signing failed: No secret key

I definitely have the correct secret key in my .gitconfig and gpg-agent is running. I've been trying to solve this for an hour and haven't been able to.

My .gitconfig:

[user]
    name = Roni Nevalainen
    email = kitten@kittenz.dev
    signingkey = (signing key)
[core]
    editor = code --wait
[commit]
    gpgsign = true
[color]
    ui = auto
[init]
    defaultBranch = main

Output of gpg --list-secret-keys:

sec   rsa4096 2020-12-19 [SC]
      (gpg key)
uid           [ unknown] Roni Nevalainen (kittenz.dev email) <kitten@kittenz.dev>
uid           [ unknown] Roni Nevalainen (GitHub key) <31485942+Cinderkittenz@users.noreply.github.com>
uid           [ unknown] Roni Nevalainen <catmaster.kissa@gmail.com>
ssb   rsa4096 2020-12-19 [E]
dan1st
  • 9,654
  • 6
  • 26
  • 57
  • Can you show your `.gitconfig` and the output of `gpg --list-secret-keys`? – dan1st Oct 07 '21 at 16:59
  • @dan1st Here's my .gitconfig (GPG key removed, both are the exact same copy-pasted) https://gist.github.com/kittenz/9b7b224c97284ce872977c5ef4d0ba78. And `gpg --list-secret-keys`: https://gist.github.com/kittenz/663cf0ad6a884f97ff97a987c4453b04 – Roni J. N. Oct 07 '21 at 17:05
  • Does the `(signing key)` in the `.gitignore` match the `(gpg key)` in the output of `gpg --list-secret-keys`? – dan1st Oct 07 '21 at 17:07
  • @dan1st yes, it does – Roni J. N. Oct 07 '21 at 17:23
  • You may want to configure the path for the gpg executable as shown by @[VonC](https://stackoverflow.com/users/6309/vonc) in [this answer](https://stackoverflow.com/a/46997768/10871900). – dan1st Oct 07 '21 at 17:29
  • That did work! Thanks! – Roni J. N. Oct 07 '21 at 17:38

0 Answers0