baidu搜了很多, 沒有結果.估計大家都沒有這個場景.google了一下, 幾篇非常不錯的結果:
https://superuser.com/questions/1104567/how-can-i-find-out-the-command-line-options-for-git-bash-exe
--command=<command-line>:: Executes `<command-line>` instead of the embedded string resource --[no-]minimal-search-path:: Ensures that only `/cmd/` is added to the `PATH` instead of `/mingw??/bin` and `/usr/bin/`, or not --[no-]needs-console:: Ensures that there is a Win32 console associated with the spawned process, or not --[no-]hide:: Hides the console window, or not
https://github.com/git/git/commit/ac6b03cb4197311b055dc5f46ab10bf37c591ae6
git-wrapper: allow overriding the command to spawn via command-line args By embedding string resources into the Git wrapper executable, it can be configured to execute custom commands (after setting up the environment in the way required for Git for Windows to work properly). This feature is used e.g. for `git-bash.exe` which launches a Bash in the configured terminal window. Here, we introduce command-line options to override those string resources. That way, a user can call `git-bash.exe` (which is a copy of the Git wrapper with `usr\bin\bash.exe --login -i` embedded as string resource) with command-line options that will override what command is run. ConEmu, for example, might want to call ...\git-bash.exe --needs-console --no-hide --minimal-search-path ^ --command=usr\\bin\\bash.exe --login -i In particular, the following options are supported now: --command=<command-line>:: Executes `<command-line>` instead of the embedded string resource --[no-]minimal-search-path:: Ensures that only `/cmd/` is added to the `PATH` instead of `/mingw??/bin` and `/usr/bin/`, or not --[no-]needs-console:: Ensures that there is a Win32 console associated with the spawned process, or not --[no-]hide:: Hides the console window, or not Helped-by: Eli Young <elyscape@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
--cd-to-home # Change directory to home --cd=<path> # Change directory to <path> -i # ? -c # Run command, but --command doesn't work/exist
usr\bin\mintty.exe --icon git-bash.exe,0 --exec "/usr/bin/bash" --login -i <other arguments>
usr\bin\mintty.exe --icon git-bash.exe,0 --window full --exec "/usr/bin/bash" --login -i -c "echo 'Hello World!'; read"
這個日本人寫得也不錯
https://teratail.com/questions/100262
