How do I run msysgit in cmder?

git, git-bash, msysgit

Solution

You can type the full path of your msysgit intallation (2014, Git 1.9.z) to launch a bash session.

For instance:

- `"c:\prgs\git\PortableGit-1.9.0-preview20140217\Git Bash.vbs"`: will open a new windows

- `"c:\prgs\git\PortableGit-1.9.0-preview20140217\git-bash.bat"`: will open a bash session within the current shell.

Those two scripts aren't part of `<msysgit/bin>` folder, and are not found in `%PATH%`.

As commented by David Grayson and pred below in the comments, using `Git-1.9.5-preview20141217.exe` does result in an installation (in C:\Program File) which does not have git-bash.bat, and which rely on "Git Bash" shortcut calling `C:\Git\bin\sh.exe --login -i`.

Don't use that setup. Use the much easier and more complete package PortableGit-1.9.5-preview20141217.7z that you unzip anywhere you want and that you add to your PATH.

Note: with the new Git for Windows releases (2015, Git 2.y.z), that would be:

- "`c:\prgs\git\PortableGit-2.3.5.8-dev-preview-64-bit\git-bash.exe`": will open a bash session within the current shell.

Problem

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?

Original source