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

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

    If everything fails, use GIT_TRACE=1 to try and see what git is actually doing:

    $ GIT_TRACE=1 git commit -m "Add page that always requires a logged-in user"
    20:52:58.902766 git.c:328               trace: built-in: git 'commit' '-vvv' '-m' 'Add page that always requires a logged-in user'
    20:52:58.918467 run-command.c:626       trace: run_command: 'gpg' '--status-fd=2' '-bsau' '23810377252EF4C2'
    error: gpg failed to sign the data
    fatal: failed to write commit object
    

    Now run the failing command manually:

    $ gpg -bsau 23810377252EF4C2
    gpg: skipped "23810377252EF4C2": Unusable secret key
    gpg: signing failed: Unusable secret key
    

    Turns out, my key was expired, git was not to blame.

提交回复
热议问题