gpg failed to sign the data fatal: failed to write commit object [Git 2.10.0]

前端 未结 30 2074
难免孤独
难免孤独 2020-11-27 23:55

I followed few articles over the pretty attributes on Git 2.10 release note. Going through which upgraded the git to 2.10.0 and made changes to global .gitconfig

30条回答
  •  感动是毒
    2020-11-28 00:46

    The git trace was very revealing for my situation...

       GIT_TRACE=1 git commit -m "a commit message"
    
       13:45:39.940081 git.c:344               trace: built-in: git commit -m 'a commit message'
       13:45:39.977999 run-command.c:640       trace: run_command: gpg --status-fd=2 -bsau 'full name '
       error: gpg failed to sign the data
       fatal: failed to write commit object
    

    I needed to generate an initial key per the format that git was checking against. It's best to copy the value passed to -bsau above in the logs as is and use below.

    So it becomes,

       gpg --quick-generate-key "full name "
    

    Then it worked.

    Hope that helps.

提交回复
热议问题