How to add tool to open Git shell in repository from msysgit (GUI)?

Is there a quick command that I can put in so that if I run this tool it will open a shell which is set to the repo’s directory? I have searched everywhere and it seems I cannot find a command that will work!

enter image description here

Answer

I finally found out how to do it:

cmd /c cd %v & start "" "C:\path\to\bin\sh.exe" --login -i

The reason why you have to pass an empty argument to the start command is because the first argument in quotes gets set as the window title. So, if you want to name your window, do this:

cmd /c cd %v & start "WINDOW TITLE HERE" "C:\path\to\bin\sh.exe" --login -i

Command explanation

  • cmd /c cd %v – Changes your current directory to the path of the repo.
  • start "WINDOW TITLE HERE" "C:\path\to\bin\sh.exe" --login -i – Starts up your shell, setting the window to WINDOW TITLE HERE, and passing --login -i to the executable sh.exe

Git Baby is a git and github fan, let's start git clone.