1

New to git on Windows. After installing the latest version of git (from the git for Windows website), you can type cd /usr/bin in standard Linux usage. But where exactly is this on my Windows file system? A search from the Windows command-line turned up two plausible locations. Which is the correct one and why are there two similar locations?

  • C:\Program Files\Git\usr\bin
  • C:\Program Files\Git\mingw64\bin
AlainD
  • 3,501
  • 2
  • 25
  • 63

1 Answers1

2

I have:

vonc@voncavn7 MINGW64 /usr
$ ls
bin  etc  lib  libexec  share  ssl

If I check usr:

D:\prgs\gits\current\usr>ls 
bin/  etc/  lib/  libexec/  share/  ssl/

And mingw64

D:\prgs\gits\current\mingw64>ls
bin/  doc/  etc/  lib/  libexec/  share/  ssl/

So it looks like it is C:\Program Files\Git\usr\bin.

As explained in "Why is “MINGW64” appearing on my Git bash?", The MINGW64 is the value from the MSYSTEM environment variable.
It is part of MSYS2, which consists of three relatively separate subsystems: msys2 , mingw32 and mingw64.

From "Zsh on Windows via MSYS2" from Borek Bernard:

  • msys2 (sometimes called just msys) is an emulation layer — fully POSIX compatible but slow.
  • mingw subsystems provide native Windows binaries, with Linux calls rewritten at compile time to their Windows equivalents.
    For example, Git for Windows is a mingw64 binary (unlike msys Git which utilizes the compatibility layer and is therefore slow).

See also "How are msys, msys2, and msysgit related to each other?".

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283