Git error - gpg failed to sign data

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

    If you are using smart card/yubikey to store your GPG key and you set the signkey of git config by the key stored in the card (and all the answer above seem not to resolve your issue), your blocked PIN of the card might be the root cause of this issue.

    To check the blocked PIN:

    gpg --card-status
    

    If the counter is similar to

    Reader ...........: Yubico YubiKey
    PIN retry counter : 3 0 3
    

    Then your PIN is blocked (after 3 unsuccessful tries).

    To unblock the PIN:

    gpg --card-edit
    gpg/card> admin
    Admin commands are allowed
    
    gpg/card> passwd
    gpg: OpenPGP card no. … detected
    
    1 - change PIN
    2 - unblock PIN
    3 - change Admin PIN
    4 - set the Reset Code
    Q - quit
    
    Your selection? 2
    PIN unblocked and new PIN set.
    
    1 - change PIN
    2 - unblock PIN
    3 - change Admin PIN
    4 - set the Reset Code
    Q - quit
    
    Your selection? q
    

提交回复
热议问题