16

I cannot commit to git . Every time I try it shows this message.

error: Couldn't load public key 632EA751459C3A1A: No such file or directory?

fatal: failed to write commit object

I'm using Gpg4Win.

1
  • Running into this issue as well, with a recently new update of Gpg4Win. It was working before. :shrug: If you've resolved this I'd love to know what it took. Assuming that gnupg can't find the pubring it created. Sep 22, 2022 at 14:03

3 Answers 3

22

I believe I resolved my issue, perhaps it is the same for you. For some reason I'd set the gpg.format value to "SSH" in my local Git config.

Simply removing that from my ~/.gitconfig allowed Gpg4Win to resolve the correct location of the key.

2
  • 4
    The correct and safer way is to git config --global --unset gpg.format
    – undefined
    Jul 19 at 23:31
  • same thing happened to me (on Mac ). no idea how it got there..
    – nicolas
    Aug 19 at 7:44
1

Telling Git about your signing key

To sign commits locally, you need to inform Git that there's a GPG, SSH, or X.509 key you'd like to use.

-3

remove format = ssh from ~/.gitconfig

2
  • 1
    What does this add to Kit Plummer's answer?
    – greybeard
    Oct 5, 2022 at 6:30
  • quick and dirty. Simpler.
    – J. Ceron
    Dec 28, 2022 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.