Git 无法在Windows 10(GnuPG)上提交使用gpg2进行签名
我正在尝试生成密钥并签署提交。我的主要名单:Git 无法在Windows 10(GnuPG)上提交使用gpg2进行签名,git,github,gnupg,Git,Github,Gnupg,我正在尝试生成密钥并签署提交。我的主要名单: gpg2——列出键: 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-2
gpg2——列出键
:
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 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的路径。可能存在什么问题
这就是为什么它仍然使用gpg,而不是gpg2,尽管我已经配置了gpg2的路径
这是因为git for windows本身在其/usr/bin
文件夹中包含一个gpg.exe
1.x,供git
命令使用
可能存在什么问题
您需要在\latest\pub
文件夹中将gpg2.exe
复制到gpg.exe
中,这样路径实际上可能在git
的gpg.exe
1.x之前包含一个gpg.exe
2.x
或者,如果它不起作用,将\latest\pub\gpg2.exe
复制到/usr/bin/gpg.exe
中,只需删除/usr/bin
下的gpg.exe文件gpg2-K
(又名gpg2-列出密钥
)怎么说?你只给公众看了一半,我也有同样的错误。gpg--version是否告诉您Git Bash中的旧版本?升级Git for windows时,您需要记住重新删除gpg.exe
。
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