How can I execute .bat from git bash and then return to the console?

I created a goToProject.bat file with this content:

cd C:\Dev\MyProject

I want to run goToProject.bat using Git Bash because I don’t want to manually go to the folder every time I have to use Git in my project.

To run goToProject.bat from Git Bash, I can do this:

$cmd goToProject.bat

By doing this, goToProject.bat is started, but the console is converted to the cmd console of windows and, if I do this:

c:\Dev\MyProject> exit

The console is converted again to the Git Bash console, but in the default route.

How can I run goToProject.bat and stay in the Git Bash console?

+4
source share
2 answers

I already found what I need:

git bash visual studio , :

  • Visual Studio: → →

  • : git Bash

  • : c:\Program Files (x86)\ git\bin\sh.exe

  • Args: --login -i

  • Dir: $(SolutionDir)

"Git Bash" "" Visual Studio, git bash .

, :

  • Visual Studio: → → →
  • , : Tools.ExternalCommand
  • ( - ) * (, Ctrl + G, Ctrl + B)
+5

.sh script .bat.

: GIT Bash -

+1

All Articles