Git Bash Here in ConEmu
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.
Solution 1:
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:
- 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
- Menu item:
- Click the Register button
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.
Solution 2:
I installed git using chocolatey and had the issue that git bash was not shown
I just had to click on "Add default tasks..." in Startup/Tasks to get {Bash::Git bash}
Solution 3:
I got Portable ConEmu version 150111 in zip archive and had the GiT Bash in tasks just out of the box. As well as some other entries. So there was no need in editing anything at all.
Solution 4:
Starting with ConEmu Portable .7z downoad and msysgit PortableGit .7z download, I created the following Windows shortcut. Of course adjust your portable path to ConEmu and Git appropriately.
LNK Target:
D:\PortableApps\ConEmu\ConEmu.exe /cmd bin\bash.exe --login -i -cur_console:n
LNK Start in:
D:\PortableApps\Git-msysgit