CodeSlayer2010 CodeSlayer2010 - 1 year ago 216
Git Question

How To Launch Git Bash from DOS Command Line?

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

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

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:

Running git from Windows Cmd line: Where are key files?

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

Any help is appreciated. Thanks in advance.

Answer Source

If you want to launch from a batch file:

  • for x86

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

    start "" "%Program Files%\Git\bin\sh.exe" --login
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download