git-bash.exe vs git-cmd.exe on Windows

Git actually ships more than one shell on Windows, you will see git-bash.exe and git-cmd.exe in Git directory. By default, you will use the git-bash.exe – Git Bash.

  • Git Bash launches mintty.exe terminal that you can find user/bin/mintty.exe in the Git directory. And Git Bash comes packaged with some commands that are located in the user/bin directory like cat, find, less, scp, sed, etc. Therefore it provides some Bash experience on Windows.

    It uses Linux path style.

    It can not be embedded into Windows Terminal application.

  • git.cmd.exe launches the Windows’s cmd.exe and it uses Windows path style. It can also use commands like ls, less, sed, etc.

    It uses Windows path style.

    git-cmd.exe can be embedded into Windows Terminal application.

    Note ^ is a line continuation character (similar to “ in Bash). To use ^ in a command like git diff HEAD^2, you need to change it to git diff HEAD^^2 to escape ^.

Reference