git-bash.exe参数

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

 

posted @   multitude  阅读(3803)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· Ollama——大语言模型本地部署的极速利器
· 使用C#创建一个MCP客户端
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· Windows编程----内核对象竟然如此简单?
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
点击右上角即可分享
微信分享提示