How do I write a batch file which opens the GitBash shell and runs a command in the shell?

前端 未结 6 1153
南方客
南方客 2020-12-01 00:22

I\'m on Windows 7 trying to use a batch file to open the GitBash shell and make a git call. This is the contents of my batch file:

REM Open GitBash 
C:\\Wind         


        
6条回答
  •  时光说笑
    2020-12-01 00:39

    In windows I created a git.bat file, and associated it to the .hook extension.

    if not exist %1 exit
    set bash=C:\Program Files (x86)\Git\bin\bash.exe
    "%bash%" --login -i -c "exec "%1""
    

    After that you can run the .hook files like every .bat or .cmd file except that they are running under git shell...

提交回复
热议问题