Out of a git console: how do I execute a batch file and then return to git console?

After playing around a bit more, I found the solution myself:

cmd "/C clean.bat"

does the trick. But I got no clue, why...


./clear.bat will do the trick.


The Git for Windows (msysGit has been superseded by Git for Windows1) FAQ says you have 3 options:

  • Run programs that have problems using the winpty utility. This allows you to keep using the nicer mintty terminal, but can become unwieldy if you need the workaround for many programs.

  • Modify the shortcut for Git Bash to run bash directly without mintty so it uses the default console host and configure it for "Quick Edit", reasonable size and scroll-back and suitable unicode font. You'll still have to live with the other quirks of console host.

  • Install and use ConEmu.