Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which git.exe should I reference?

Tags:

git

windows

mingw

Git for Windows has installed four git.exe files.

They seem slightly different (comparing bytes).

Which should I use for other applications that want a reference to 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
like image 232
BanksySan Avatar asked Nov 11 '16 20:11

BanksySan


People also ask

Where is my git exe path?

1 Answer. If on windows, the default path is C:\Program Files (x86)\Git. The name of the executable is not git.exe for all systems.

Where can I find git exe in Windows?

The default path on windows is C:\Program Files (x86)\Git . The name of the executable is not git.exe on all systems.

What is git EXE used for?

Git is a DevOps tool for source code management—an open-source version control system (VCS) used to handle small to very large projects efficiently.

What is git path?

On the next step, you should choose where to install the program. The default path is “C:\Program Files\Git“. If you want the software installed in a different location click Browse and specify a different folder.


2 Answers

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 : <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
    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

    <?if $(var.SixtyFourBit)=64 ?>
        <Directory Id='MingwFolder' Name='mingw64' />
    <?else?>  
    
  • \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}" ...

like image 172
CodeWizard Avatar answered Oct 21 '22 04:10

CodeWizard


When you are using from your windows command prompt you should be referring to the, \Program Files\Git\bin\git.exe

The ones under mingw64 are used with the Git bash interface.

like image 26
Jerin Joseph Avatar answered Oct 21 '22 03:10

Jerin Joseph