error: gpg failed to sign the data fatal: failed to write commit

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangbingfengf98/article/details/88728565

After install gpg, config step by step follow the offical doc, but when use

$ git commit -m "test gpg verfified"

It prompt error

error: gpg failed to sign the data
fatal: failed to write commit object

after some research, when use

$ source ~/.bash_profile
nvm is not compatible with the npm config "prefix" option: currently set to "/Users/wangbingfeng/anaconda3"
Run `npm config delete prefix` or `nvm use --delete-prefix v6.10.0 --silent` to unset it.

The solution

npm config delete prefix

works for me.

After commited, click below Compare & pull request link

Compare & pull request

the "Verified tag" show.

list our all keyids info:

$ gpg --list-secret-keys --keyid-format LONG

 commit with gpg key:

$ git commit -S -m "add commit verified"

git operate info: https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches

references:

1. https://help.github.com/en/articles/managing-commit-signature-verification

2. https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work

3. https://seven.ooo/sign-git-commits-with-gpg-key/#%E6%AD%A5%E9%AA%A4

猜你喜欢

转载自blog.csdn.net/wangbingfengf98/article/details/88728565
今日推荐