Git Bash ConEmu – How to Use Git Bash Here in ConEmu

bashconemugitwindows

How do I create a right-click context menu entry to open Git Bash at a given folder within ConEmu? See Git Bash Here in Console2 for the equivalent question for Console2.

Best Answer

There are a number of ways this can be done in ConEmu as it is so highly configurable, but here's the way I do it.

  • In ConEmu, hit WinAltp to open the settings dialog.
  • Select the Tasks subsection under the Startup node and click the + icon to add a new 'Task'
  • In the Task Name field enter Git Bash, leave Task Parameters blank and add "C:\Program Files\Git\bin\sh.exe" --login -i to the Commands section. It should look something like this:

Git Bash task

  • Now select the Integration node and enter the following under the ConEmu Here - Explorer menu integration section:
    • Menu item: ConEmu Here [Git Bash]
    • Command: /single /cmd {Git Bash}
    • Icon file: C:\Program Files\Git\mingw64\share\git\git-for-windows.ico
  • Click the Register button

Integration

This should add an entry in your right-click context menu (complete with icon). In the Command field you can use any of the ConEmu.exe switches (worth checking out for more complete documentation of what you can do - it's pretty powerful).

Note: If you'd like a Git for Windows icon to appear at the top left of the ConEmu window, use the /icon switch; e.g.,

/icon "C:\Program Files\Git\mingw64\share\git\git-for-windows.ico" /single /cmd {Git Bash}

This only seems to work if it's the first tab open, though.

Related Question