Git error - gpg failed to sign data

前端 未结 26 1457
遇见更好的自我
遇见更好的自我 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:46

    This worked for me on ubuntu 18.04

    Check your gpg key

    gpg -K --keyid-format LONG
    

    if you get a blank response ,generate a GPG key

    gpg --generate-key
    

    rerun the first command, you should get an output as:

    sec   rsa3072/95A854E0593B3214 2019-05-06 [SC] [expires: 2021-05-05]
          AF2F7514568DC26B0EB97B9595A854E0593B74D8
    uid                 [ultimate] yourname
    ssb   rsa3072/EFD326E6C611117C 2019-05-06 [E] [expires: 2021-05-05]
    

    set git singing key

    git config --global user.singingkey 95A854E0593B3214
    

    then you are good to go! (--global is optional)

    Alternatively if you dont mind signing with your ssh key

    git config commit.gpgsign false
    

    note that this is not recommended due to a security issue according to this question here and here

提交回复
热议问题