How To Launch Git Bash from DOS Command Line?

前端 未结 9 1695
北海茫月
北海茫月 2020-12-07 08:21

I\'ve got what I\'m hoping is a simple question, but I haven\'t been able to find the answer yet. I would like to launch Git Bash from a DOS batch file. Here is what I tri

9条回答
  •  执笔经年
    2020-12-07 08:48

    I prefer to use git-bash.exe instead of sh.exe.

    start "" "%ProgramFiles%\Git\git-bash.exe" -c "tail -f /c/Windows/win.ini"
    

    You can stop closing the window when call /usr/bin/bash --login -i in the end;

    start "" "%ProgramFiles%\Git\git-bash.exe" -c "echo 1 && echo 2 && /usr/bin/bash --login -i"
    

    Note: I'm not sure this is a good way :)

提交回复
热议问题