gpt4 book ai didi

linux - 如何查看 Git cmd 使用的是哪个 gpg homedir 版本和 `homedir`?

转载 作者:可可西里 更新时间:2023-11-01 10:33:13 25 4
gpt4 key购买 nike

我正在尝试在 LinuxWindows 平台上调试各种版本的 GitGPG .

根据 gitgpg 手册页:

  • Git 使用 gpg.program 配置选项来定位 gpg cmd;
  • GPG 使用 GNUPGHOME 环境变量(或 Windows 下的 HKCU\Software\GNU\GnuPG:HomeDir) .
  • 根据 this answer , exporting GIT_TRACE=1 env-var 你变得冗长有关 git 操作的信息,但对我而言,这些还不够。

有没有办法验证 git cmd 使用的 gpg 的实际 homedirr 和可执行路径?

最佳答案

Is there a way to verify the actual homedir and executable-path of gpg

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

echo $HOME
which gpg

对我来说:

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

(/为Git安装根文件夹)

您还可以键入 set GIT_TRACE=2(或在 bash session 中输入 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 本身的那个。

关于linux - 如何查看 Git cmd 使用的是哪个 gpg homedir 版本和 `homedir`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42076162/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com