How do I run msysgit in cmder?

shroy picture shroy · Aug 3, 2014 · Viewed 13.6k times · Source

I was using msysgit and git-bash in cmder when I accidentally exited out of it.
Now I can't seem to figure out how to get to the unix environment I previously had.

Git bash is not recognized as a command.
All I see is the typical command window prompt displaying the C:/User/.. rather than the $~User.

How would you restore the git bash session?

Answer

Nick F picture Nick F · May 18, 2015

An easy way to get this working is to define a custom "bash" task in Cmder, and then configure it to use this task by default.

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters - set the icon:
      • Either /icon "%CMDER_ROOT%\cmder.exe" (for Cmder icon) or /icon "C:\Program Files (x86)\Git\etc\git.ico" (for Git icon)
    • Commands - open Git's bash shell:
      • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
  • Under Startup, set startup options to Specified name task --> {bash}

...this will set Git bash as the default console in Cmder.

nb. The above obviously assumes that Git is installed in "C:\Program Files (x86)\Git" - if that's not the case, you'll need to change the path to point to wherever Git is installed.