如何查看哪个gpg homedir版本和`homedir` Git cmd正在使用?

我试图在LinuxWindows平台上debugging各种版本的GitGPG的 安装

根据gitgpg手册页:

  • Git使用gpg.programconfiguration选项来定位gpg cmd;
  • GPG使用GNUPGHOME环境variables(或Windows下的HKCU\Software\GNU\GnuPG:HomeDir )。
  • 根据这个答案 ,导出GIT_TRACE=1 env-var你得到了关于git动作的详细信息,但是对于我来说这些还不够。

有没有办法来validationgit cmd使用的gpg的实际homedirr和可执行文件path?

有没有一种方法来验证gpg的实际homedir和可执行文件路径

只需打开一个git bash会话并输入:

 echo $HOME which gpg 

为了我:

 vonc@bigvonc MINGW64 ~/git/git (master) $ which gpg /usr/bin/gpg 

/是Git安装根目录)

你也可以输入set GIT_TRACE=2 (或者在bash会话中export GIT_TRACE=2 ),并使用一个git命令来包含gpg

 C:\Users\vonc\prog\git\git>git tag -v v1.4.2.1 20:58:52.193034 git.c:371 trace: built-in: git 'tag' '-v' 'v1.4.2.1' 20:58:52.245921 run-command.c:369 trace: run_command: 'gpg' '--status-fd=1' '--keyid-format=long' '--verify' 'C:/Users/vonc/AppData/Local/Temp/.git_vtag_tmp4moGKa' '-' object 883653babd8ee7ea23e6a5c392bb739348b1eb61 type commit tag v1.4.2.1 tagger Junio C Hamano <junkio@cox.net> 1158138501 -0700 GIT 1.4.2.1 Minor fixes since 1.4.2, including git-mv and git-http with alternates. gpg: Signature made Wed Sep 13 11:08:25 2006 RDT gpg: using DSA key C0C6D9A4F3119B9A gpg: Can't check signature: public key not found 

这里gpg$PATH那个:

 C:\Users\vonc\prog\git\git>where gpg C:\prgs\git\latest\usr\bin\gpg.exe C:\prgs\gpg2\latest\pub\gpg.exe 

就我而言,它是Git本身首先使用的。