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 Windows batch file. Here is what I tried so far:
Launched Git Bash from Win 7 Start button
Used CTRL+ALT+DEL to identify the process as "sh.exe"
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 searching the web, 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 a beginner in the world of Windows batch scripting.
command.com
is the only shell included with the OS (b) You're on a 32-bit NT system and either invokedcommand.com
yourself, or an old program did it for you. See What is the difference between CMD and Command prompt in windows? for more info. – Sequencebatch
file this worked for me:start "" "%PROGRAMFILES%\Git\git-bash.exe" --cd-to-home
– Positronstart "D:\MyNiceFolder" "%PROGRAMFILES%\Git\bin\sh.exe" --login
. Its even better to pin a shortcut in start menu by following this article. – Deerdre