Using Git Bash Here in Console2

consoleconsole2gitmsysgit

MSysGit installs a context menu item that opens a Git Bash prompt at the currently selected folder; however, this opens a cmd.exe window and I would like it to open in Console2 instead.

What modifications do I need to make to get this working?

Note, I have seen this related question, but the answer is outdated – MSysGit is now using a vba script to invoke the bash prompt. Plus it doesn't explicity state how to get things working with Console2.

Update: you may be interested in doing the same with ConEmu, a rather excellent successor to Console. See here: Git Bash Here in ConEmu

Best Answer

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\""
Related Question