2016-11-26 53 views
2

我試圖生成密鑰並簽署提交。我的密鑰列表:無法承諾在Windows 10上使用gpg2簽名(GnuPG)

gpg2 --list-keys

C:/Users/raski/AppData/Roaming/gnupg/pubring.gpg 

------------------------------------------------ 
pub 2048R/8E3A3251 2016-11-26 
uid  [ultimate] My Name <[email protected]> 
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 
[email protected] 
user.signingkey=8E3A3251 
commit.gpgsign=true 
gpg.program=D:/Programs/GnuPG/pub/gpg2 

我嘗試做一個承諾:

git commit -m "initial" 

此前,添加我的公共PGP密鑰的設置Github上。但是,我有錯誤:

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,而不是GPG 2,雖然我已經配置爲gpg2的路徑。存在什麼問題?

+0

什麼是'gpg2 -K'(又名'gpg2 --list-secret-keys')說?你只是在這裏展示公衆的一半。 – jthill

回答

1

It is why it is still using gpg, instead of gpg 2, although I have configured the path to gpg2.

那將是因爲git的窗戶本身也包括在其<git>/usr/bin文件夾gpg.exe 1.x中,通過git命令使用。

What can be the problem exists?

你需要在你的<gpg2>\latest\pub文件夾gpg2.exe複製到gpg.exe,這樣的PATH實際上可能包括從gitgpg.exe 1.x的前gpg.exe 2.X。
或者,如果它不起作用,請將<gpg2>\latest\pub\gpg2.exe複製到<git>/usr/bin/gpg.exe中。

0

只需在<git>/usr/bin下刪除gpg.exe文件即可。

+0

當您升級Windows的git時,您需要記得重新調用'gpg.exe'。 – mrm