chris_f
chris_f

Reputation: 1198

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...

Upvotes: 3

Views: 1503

Answers (1)

chris_f
chris_f

Reputation: 1198

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.

Upvotes: 6

Related Questions