我应该参考哪个 git.exe?
Which git.exe should I reference?
Git for Windows 已经安装了四个 git.exe
文件。
它们似乎略有不同(比较字节)。
对于需要引用 git.exe 的其他应用程序,我应该使用哪个?
\Program Files\Git\bin\git.exe
\Program Files\Git\cmd\git.exe
\Program Files\Git\mingw64\bin\git.exe
\Program Files\Git\mingw64\libexec\git-core\git.exe
当您在 windows 命令提示符下使用时,您应该指的是 \Program Files\Git\bin\git.exe
mingw64
下面的是配合Gitbash接口使用的
不同的版本各有不同的用途。
\Program Files\Git\bin\git.exe
这是实际的 git 二进制文件,如果你 运行 它形成任何脚本等,它会添加到你的路径中
此条目在 windows 的 git 源脚本中找到:
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/portable/release.sh
\Program Files\Git\cmd\git.exe
这是 git,当您添加已安装并选择将 git 添加到您的 cmd
(windows 路径)
时,它是 运行
可以在此处的源中找到此条目:<File Id="GitExe" Source="cmd\git.exe" />
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/msi/release.sh
\Program Files\Git\mingw64\bin\git.exe
这是 git-bash 版本,由 git-bash cygwin 模拟器
使用
它在 wxs(安装程序文件)中定义
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/msi/GitProduct.wxs
<?if $(var.SixtyFourBit)=64 ?>
<Directory Id='MingwFolder' Name='mingw64' />
<?else?>
\Program Files\Git\mingw64\libexec\git-core\git.exe
Thisone 也适用于模拟器,并在此处定义:
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/git-extra/git-prompt.sh
if test -z "$WINELOADERNOEXEC"
then
GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
...
Git for Windows 已经安装了四个 git.exe
文件。
它们似乎略有不同(比较字节)。
对于需要引用 git.exe 的其他应用程序,我应该使用哪个?
\Program Files\Git\bin\git.exe
\Program Files\Git\cmd\git.exe
\Program Files\Git\mingw64\bin\git.exe
\Program Files\Git\mingw64\libexec\git-core\git.exe
当您在 windows 命令提示符下使用时,您应该指的是 \Program Files\Git\bin\git.exe
mingw64
下面的是配合Gitbash接口使用的
不同的版本各有不同的用途。
\Program Files\Git\bin\git.exe
这是实际的 git 二进制文件,如果你 运行 它形成任何脚本等,它会添加到你的路径中此条目在 windows 的 git 源脚本中找到:
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/portable/release.sh
时,它是 运行\Program Files\Git\cmd\git.exe
这是 git,当您添加已安装并选择将 git 添加到您的cmd
(windows 路径)可以在此处的源中找到此条目:
<File Id="GitExe" Source="cmd\git.exe" />
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/msi/release.sh
使用\Program Files\Git\mingw64\bin\git.exe
这是 git-bash 版本,由 git-bash cygwin 模拟器它在 wxs(安装程序文件)中定义
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/msi/GitProduct.wxs<?if $(var.SixtyFourBit)=64 ?> <Directory Id='MingwFolder' Name='mingw64' /> <?else?>
\Program Files\Git\mingw64\libexec\git-core\git.exe
Thisone 也适用于模拟器,并在此处定义:
https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/git-extra/git-prompt.shif test -z "$WINELOADERNOEXEC" then GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)" COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}" ...