我将尝试生成密钥并签署提交。我的密钥列表如下:
gpg2 --list-keys
:
C:/Users/raski/AppData/Roaming/gnupg/pubring.gpg
------------------------------------------------
pub 2048R/8E3A3251 2016-11-26
uid [ultimate] My Name <raski@example.com>
sub 2048R/29C8D116 2016-11-26
git config --global -l
:
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.required=true
user.name=roma
user.email=raski@example.com
user.signingkey=8E3A3251
commit.gpgsign=true
gpg.program=D:/Programs/GnuPG/pub/gpg2
我尝试提交:
git commit -m "initial"
之前,我在Github的设置中添加了我的公共PGP密钥。但是,出现了错误:
gpg: skipped "2048R/8E3A3251": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
这就是为什么它仍在使用gpg而不是gpg2,尽管我已经配置了gpg2的路径。可能存在什么问题呢?