Git error - gpg failed to sign data

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

    Solution:

    Issue: Disabled loopback pinentry mode
    

    To solve the problem, you need to enable loopback pinentry mode in ~/.gnupg/gpg.conf:

    cat <<'EOF' >> ~/.gnupg/gpg.conf
    
    use-agent 
    pinentry-mode loopback
    
    EOF
    

    And also in ~/.gnupg/gpg-agent.conf (create the file if it doesn't already exist):

    cat <<'EOF' >> ~/.gnupg/gpg-agent.conf
    
    allow-loopback-pinentry
    
    EOF
    

    Then restart the agent with echo RELOADAGENT | gpg-connect-agent and you should be good to go!

    Source

提交回复
热议问题