我试图在Linux和Windows平台上debugging各种版本的Git & GPG的 安装 。
根据git
& gpg
手册页:
gpg.program
configuration选项来定位gpg
cmd; 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本身首先使用的。