'How can I suppress path expansion in the Git-for-Windows bash?

I'm struggling with Git-for-Windows bash: I try to exec into the shell of a kubernetes container, but git bash always prepends a windows path to the shell argument: kubectl run test --image=alpine:latest -it /bin/sh gets executed as "C:\Program Files\Docker\Docker\resources\bin\kubectl.exe" run test --image=alpine:latest -it "C:/Program Files/Git/usr/bin/sh".

How can I prevent the expansion of the /bin/sh part? Quoting with single quotes (') or double quotes (") didn't help...



Solution 1:[1]

Answers from David Macek and Johannes Schindelin in the Git-for-Windows Gitter chat:

David Macek @elieux 18:51

Hi. Try kubectl run test --image=alpine:latest -it //bin/sh. Otherwise see https://www.msys2.org/wiki/Porting/#filesystem-namespaces for MSYS2_ARG_CONV_EXCL.

Johannes Schindelin @dscho 11:35

In Git for Windows, we have the more convenient MSYS_NO_PATHCONV variable, too, which is documented in the Known Issues section of the Release Notes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 chris_f