0

I am creating a context menu handler to open Bash via right click.

My command works with all git bash.exe files:

C:\Program Files\Git\git-bash.exe
C:\Program Files\Git\bin\bash.exe
C:\Program Files\Git\usr\bin\bash.exe

Each opens a bash shell and seems fine.

One difference I noticed is that git-bash.exe looks a little different. The color settings are tweaked. When I first installed git I changed the color palette, but it didn't seem to carry over to the other bash executables.

I think this is because it's running mintty / or as one user explained, git-bash.exe is actually a windows app.

There is a question already on this site that supplies a little more information:

Git for Windows: Difference between Git\bin\bash.exe and Git\usr\bin\bash.exe

%programfiles%\git\bin\bash.exe -> %programfiles%\git\usr\bin\bash.exe + some automatically injected arguments = inline [ main stdin/stdout ] bash shell provided by git layered on top of windows cmd.exe command prompt environment

%programfiles%\git\git-bash.exe = windows app [ winmain ] bash shell provided by git layered on top of windows cmd.exe command prompt environment

This sheds a bit more light on the topic, but I'm still a little confused by this reply.

  1. Is he saying that %programfiles%\git\bin\bash.exe is the same thing as %programfiles%\git\usr\bin\bash.exe?
  2. Do both of these binaries have these "automatically injected arguments"?
  3. What are the arguments he's talking about?

And ultimately, the million dollar question:

What exact binary of git bash should I be calling for general use?

fmotion1
  • 237
  • 4
  • 12
  • In many distributions, `/bin/bash` and `/usr/bin/bash` are exactly the same thing and are hardlinked. – Ted Lyngmo Jul 15 '23 at 05:20
  • That's good information to know. Thank you for the input. For now I think I am going to run with /bin/bash then. I don't think I want the overhead that `git-bash.exe` introduces with Mintty, etc. – fmotion1 Jul 15 '23 at 05:24
  • You could check which version they are too with `bash --version`. I'm not sure if that works with `git-bash` though. `git-bash` seems to be running `sh.exe --login -i` – Ted Lyngmo Jul 15 '23 at 05:34
  • The name of an EXE file does not really tell you a lot. The question is, what exactly did you install when creating these executables? – user1934428 Jul 17 '23 at 08:30

0 Answers0