You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
! aliases not working in MinGit busybox builds #5184
Still reproduces with MinGit-2.55.0.5-busybox-64-bit.zip when the PATH contains only C:\Windows\System32, C:\Windows and MinGit's cmd directory. With GIT_TRACE=1:
trace: start_command: .../mingw64/bin/busybox.exe -c 'echo Hello World' 'echo Hello World'
-c: applet not found
Root cause: git_shell_path() looks up sh in the PATH and uses the result as argv[0]. The BusyBox variant ships no sh.exe, so the applet fallback in compat/mingw.c returns the path of busybox.exe itself, and BusyBox reads -c as an applet name. If any other sh.exe happens to be on the PATH (an MSYS2 install, for example) the alias works, which is why this is easy to miss.
git-for-windows/build-extra#746 ships a copy of busybox.exe as mingw64/bin/sh.exe in the BusyBox-based MinGit, as suggested above. Verified against the extracted 2.55.0.5 zip: ! aliases, clones from local paths, and hooks with #!/bin/sh and #!/bin/bash shebangs all work with the restricted PATH.
Activity
ibaidev commentedon Oct 1, 2024
It seems that it is trying to use busybox as a shell:
and:
Shouldn't the shell be something like
busybox.exe sh?jp311 commentedon Dec 7, 2024
run-command.c#L295 has issue.
If using busybox, you should also add "sh" to execute the command, like "busybox sh -c '...'"
dscho commentedon Dec 9, 2024
That, or switch to shipping
busybox.exerenamed tosh.exein/mingw64/bin(which will make it act as the default shell), maybe.mingit: ship BusyBox as sh.exe in the BusyBox-based MinGit
zcsizmadia commentedon Sep 17, 2026
Still reproduces with
MinGit-2.55.0.5-busybox-64-bit.zipwhen the PATH contains onlyC:\Windows\System32,C:\Windowsand MinGit'scmddirectory. WithGIT_TRACE=1:Root cause:
git_shell_path()looks upshin the PATH and uses the result as argv[0]. The BusyBox variant ships nosh.exe, so the applet fallback incompat/mingw.creturns the path ofbusybox.exeitself, and BusyBox reads-cas an applet name. If any othersh.exehappens to be on the PATH (an MSYS2 install, for example) the alias works, which is why this is easy to miss.git-for-windows/build-extra#746 ships a copy of
busybox.exeasmingw64/bin/sh.exein the BusyBox-based MinGit, as suggested above. Verified against the extracted 2.55.0.5 zip:!aliases, clones from local paths, and hooks with#!/bin/shand#!/bin/bashshebangs all work with the restricted PATH.mingit: ship BusyBox as sh.exe in the BusyBox-based MinGit