How do I launch a Git Bash window with particular working directory using a script?

holocronweaver picture holocronweaver · Nov 11, 2013 · Viewed 107k times · Source

How can I launch a new Git Bash window with a specified working directory using a script (either Bash or Windows batch)?

My goal is to launch multiple Git Bash windows from a single script, each set to a different working directory. This way I can quickly get to work after booting the computer instead of having to open Git Bash windows and navigating each one to the correct working directory.

I am not asking how to change the default working directory, like this question does, but to launch one or more terminal windows with different working directories from a script.

Answer

Drew Noakes picture Drew Noakes · Aug 20, 2015

Another option is to create a shortcut with the following properties:

enter image description here

Target should be:

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

Start in is the folder you wish your Git Bash prompt to launch into.