Confusion about different git.exe

402 views
Skip to first unread message

Lukas Haase

unread,
Jul 16, 2014, 9:10:06 PM7/16/14
to msy...@googlegroups.com
Hi,

Starting from strange phenomens with git-annex I found that there are 3
git.exe installed:

bin\git.exe
cmd\git.exe
libexec\git-core\git.exe

Why? And what do they do? Which one is the correct one?

I encountered the problem that when I call bin/git.exe, it does not find
the ssh config. Particularly, it expects it in "c:\Program Files
(x86)\Git\etc\ssh\ssh_config" rather than %USERPROFILE%\.ssh\config
Why is this the case?

Thanks,
Lukas

Stepan Kasal

unread,
Jul 17, 2014, 3:17:18 AM7/17/14
to Lukas Haase, msy...@googlegroups.com
Hello Lukas,

> Starting from strange phenomens with git-annex I found that there are 3
> git.exe installed:
>
> bin\git.exe
> cmd\git.exe
> libexec\git-core\git.exe
>
> Why? And what do they do? Which one is the correct one?

cmd/git.exe is a wrapper that sets up some environment and calls the
"real one", i.e. bin/git.exe

When calling git from a Windows program, use cmd/git.exe; this is also the
dir that should go to Windows path.

bin/git.exe should be called only from bash command prompt - its startup
code sets things up.

About the third one... There are actually only two files on your disk.
But the "real git" is linked under more than hundred names (git-commit.exe,
git-log.exe, etc.) Two of the names are git.exe (in different directories).
This is just a technical issue (these used to be individual executables,
but have been integrated into one).

Just ignore libexec/git-core, it's git's internal issue.

Stepan

Johannes Schindelin

unread,
Jul 17, 2014, 9:25:18 AM7/17/14
to Lukas Haase, msy...@googlegroups.com
Hi Lukas,

On Wed, 16 Jul 2014, Lukas Haase wrote:

> Starting from strange phenomens with git-annex I found that there are 3
> git.exe installed:
>
> bin\git.exe
> cmd\git.exe
> libexec\git-core\git.exe

The idea is that you let the Git installer do whatever it needs to do,
based on *your* choice of 'Use Git from Git Bash only', 'Use Git from the
Windows Command Prompt' or 'Use Git and optional Unix tools from the
Windows Command Prompt'.

As soon as you try to play games by editing your PATH, you are kind of
expected to already be familiar with the mapping between the
afore-mentioned choices and the corresponding directories.

Ciao,
Johannes
Reply all
Reply to author
Forward
0 new messages