Git error - gpg failed to sign data

前端 未结 26 1530
遇见更好的自我
遇见更好的自我 2020-12-07 07:19

I just started using git and I install git and gpg via homebrew. For some reason, I get this error when i do git commit I looked at so many other stackoverflow

26条回答
  •  被撕碎了的回忆
    2020-12-07 07:34

    In my case, I had to match the name stored in GitHub settings to the name and comment of the key.

    So if gpg --list-keys returns uid [ultimate] Joe Blogs (fancy comment) your name in .gitconfig should be Joe Blogs (fancy comment).

    Initially, I had my name set as Joe Blogs and GPG would not find my key and show the "no secret key" error in strace. Unfortunately, that error didn't appear without strace and one would get the generic

    error: gpg failed to sign the data
    fatal: failed to write commit object
    

提交回复
热议问题