如何从DOS命令行启动Git Bash? [英] How To Launch Git Bash from DOS Command Line?

查看:1234
本文介绍了如何从DOS命令行启动Git Bash?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我想要的是一个简单的问题,但我还没有能够找到答案。我想从一个DOS批处理文件启动Git Bash。这是我到目前为止尝试:

I've got what I'm hoping is a simple question, but I haven't been able to find the answer yet. I would like to launch Git Bash from a DOS batch file. Here is what I tried so far:

1)从Win 7启动Git Bash开始按钮
2)用于标识过程为sh.exe
3)使用start命令从批处理文件启动sh.exe

1) Launched Git Bash from Win 7 Start button 2) Used to identify the process as "sh.exe" 3) Launched sh.exe from batch file using start command

start sh.exe

但是,这不会启动完整的Git Bash环境。 Git Bash通常在标题栏中有MINGW32,但sh.exe有一个完整的路径... Git\bin \sh.exe。感觉对我来说,有一些覆盖或依赖,我不知道可能,还需要加载(拉入?导入?)。

However, this does not launch the full Git Bash environment. Git Bash usually has "MINGW32" in the title bar, but sh.exe has a full path to ... Git\bin\sh.exe. It feels to me like there are some overlays or dependencies that I'm not aware of possibly, that also need to be loaded (pulled in? imported?).

是我通过Googling发现的最好的结果之一,但它对我并不完全有意义,我不知道它是否适用于我的情况:

This was one of the top results I found through Googling, but it doesn't make complete sense to me and I'm not sure if it applies exactly to my situation:

从Windows Cmd行运行git:密钥文件在哪里?

我在DOS批处理脚本的世界里大约7岁,所以要温柔。

I'm about 7-years-old in the world of DOS batch scripting, so be gentle.

任何帮助是赞赏。提前感谢。

Any help is appreciated. Thanks in advance.

推荐答案

如果您要从批处理文件启动:

If you want to launch from a batch file:


  • 适用于x86

  • for x86

start "" "%SYSTEMDRIVE%\Program Files (x86)\Git\bin\sh.exe" --login


  • for x64

  • for x64

    start "" "%Program Files%\Git\bin\sh.exe" --login
    


  • 这篇关于如何从DOS命令行启动Git Bash?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆