Git Bash Here in Console2?

Solution 1:

Here's what I did (your paths with almost certainly vary):

  1. Create a new tab in Console with the following values:
    • Title: Git Bash
    • Icon: C:\Program Files\Git\etc\git.ico
    • Shell "C:\Program Files\Git\bin\sh.exe" --login -i
    • Startup dir: %HOMEDRIVE%%HOMEPATH%
  2. Create a new key in HKEY_CLASSES_ROOT\Directory\shell\ called git_shell2 with a data value of Git Console Here
  3. Create a new key in HKEY_CLASSES_ROOT\Directory\shell\git_shell2\ called command with a data value of "C:\Users\charlesr\My Dropbox\Software\Console2\Console.exe" -t "Git Bash" -d "%1"

This does the trick.

Instead of doing steps 2 and 3 above, you could just copy the following into a .reg file (modify the paths to suit your own config first) then import into the registry.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\git_shell2]
@="Git Console Here"

[HKEY_CLASSES_ROOT\Directory\shell\git_shell2\command]
@="\"C:\\Users\\charlesr\\My Dropbox\\Software\\Console2\\Console.exe\" -t \"Git Bash\" -d \"%1\""

Solution 2:

The vba script just launches the Git Bash shortcut in the same directory; just change that shortcut to make it point at Console2's executable and configure Console2 so that it uses MSysGit's sh as its shell.


UPDATED

Going into more details as I just needed to do it again on a new computer:

  • Configuring Console2

    1. added a new tab called "git"
    2. set the icon to C:\Program Files (x86)\Git\etc\git.ico
    3. set the shell to C:\Program Files (x86)\Git\bin\sh.exe --login -i
  • Tweaking Git Bash's shortcut

    1. change the shortcut target to C:\Tools\Console2\Console.exe -t git -d . (well where your Console2 binary is located)
    2. enjoy your new "Git Bash Here" launching Console2!

The trick is the "-d ." option passed to Console2: the Git Bash.vbs script changes the current directory to the point pointed by the mouse before launching the shortcut.

Hope that helps.