Git commit failed : Couldn't load public key
Asked Answered
C

4

30

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.

Chiliarch answered 15/9, 2022 at 7:0 Comment(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.Kutzenco
K
37

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.

Kutzenco answered 22/9, 2022 at 14:9 Comment(2)
The correct and safer way is to git config --global --unset gpg.formatMultiple
same thing happened to me (on Mac ). no idea how it got there..Ulcer
R
3

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.

Readability answered 15/11, 2022 at 16:31 Comment(0)
G
0

Make sure you have your ssh agent turned on and running. I have closed strongbox (my password manager and ssh agent) and it has shown this error. The fix is to simply turn your ssh agent on...

Grassofparnassus answered 19/3 at 12:40 Comment(0)
F
-3

remove format = ssh from ~/.gitconfig

Firdausi answered 4/10, 2022 at 20:36 Comment(2)
What does this add to Kit Plummer's answer?Planimeter
quick and dirty. Simpler.Firdausi

© 2022 - 2024 — McMap. All rights reserved.