Which git.exe should I reference?

后端 未结 2 1868
离开以前
离开以前 2021-02-20 00:18

Git for Windows has installed four git.exe files.

They seem slightly different (comparing bytes).

Which should I use for other applicatio

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-20 01:01

    The different version are each one for a different purpose.

    • \Program Files\Git\bin\git.exe
      This is the actual git binary which is added to your path if you run it form any script etc.

      This entry found here in the git source script for windows:
      https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/portable/release.sh

    • \Program Files\Git\cmd\git.exe
      This is the git which is run when you add installed and choose to add git to your cmd (windows path)

      This entry can be found here in the source : https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/msi/release.sh

    • \Program Files\Git\mingw64\bin\git.exe
      This is the git-bash version which is used by the git-bash cygwin emulator

      It defined here in the wxs (installer file)
      https://github.com/git-for-windows/build-extra/blob/69c134c3c2c46bce1083d5bd4596d26543ca5f0f/msi/GitProduct.wxs

      
          
        
      
    • \Program Files\Git\mingw64\libexec\git-core\git.exe
      Thisone is also for the emulator and is being defined here:
      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}" ...

提交回复
热议问题