On Windows what is the difference between Git Bash vs Windows Power Shell vs Command prompt

Git bash is bash, which is IIRC also the default shell on MacOS. It is not the default shell on Windows, although several implementations exist (CygWin, MinGW, …). Git is bundled with a number of POSIX (UNIX/Linux/etc.) utilities in addition to bash; in order to avoid “collisions” with similarly named Windows commands, the most common … Read more

Bash in Git for Windows: Weirdness when running a command with CMD.exe /C with args

This is actually documented in the ReleaseNotes file (in the top level folder of your installed Git for Windows) Also, extra care has to be paid to pass Windows programs Windows paths, as they have no clue about MSys style POSIX paths — You can use something like $(cmd //c echo “$POSIXPATH”). If you use … Read more

Git Bash – string parameter with ‘/’ at start is being expanded to a file path. How to stop this?

The release notes to the Git Bash 2.21.0 update today mentioned this as a known issue. Fortunately, they also described two solutions to the problem: If you specify command-line options starting with a slash, POSIX-to-Windows path conversion will kick in converting e.g. “/usr/bin/bash.exe” to “C:\Program Files\Git\usr\bin\bash.exe”. When that is not desired — e.g. “–upload-pack=/opt/git/bin/git-upload-pack” or … Read more