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

前端 未结 30 2065
难免孤独
难免孤独 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:28

    The answers above are great but they did not work for me. What solved my issue was exporting both the public and secret keys.

    list the keys from machine where we are exporting from

    $ gpg --list-keys
    /home/user/.gnupg/pubring.gpg
    --------------------------------
    pub 1024D/ABCDFE01 2008-04-13
    uid firstname lastname (description) 
    sub 2048g/DEFABC01 2008-04-13
    

    export the keys

    $ gpg --output mygpgkey_pub.gpg --armor --export ABCDFE01
    $ gpg --output mygpgkey_sec.gpg --armor --export-secret-key ABCDFE01
    

    go to machine we are importing to and import

    $ gpg --import ~/mygpgkey_pub.gpg
    $ gpg --allow-secret-key-import --import ~/mygpgkey_sec.gpg
    

    bingo bongo, you're done!

    reference: https://www.debuntu.org/how-to-importexport-gpg-key-pair/

    ps. My keys were originally made on bootcamp windows 7 and I exported them onto my mac air (same physical machine, different virtually)

提交回复
热议问题