How to start MingW Console (GitBash) from Command Line on Windows?

前端 未结 1 1101
终归单人心
终归单人心 2021-02-05 16:01

I\'m trying to automate my work environment set up using a batch file. I\'m stuck at a point where I am not able to start the MingW64 Console from command line.

st

1条回答
  •  醉话见心
    2021-02-05 16:36

    git-bash.exe -i -c "/bin/bash" seems to work better.
    This issue illustrates various other ways to call git-bash.exe, but concludes:

    Preferred way to run git-for-windows is using git-cmd.exe:

    c:\git\git-cmd.exe --command=usr/bin/bash.exe -l -i
    

    That however only opens a session in the current cmd, while git-bash.exe opens a new windows.

    Combined with this question (to open a new console) and this one (to avoid two CMD windows), I would use:

    start /b cmd /c git-bash.exe -i -l -c "/bin/bash"
    

    The OP Atif Mohammed Ameenuddin reports in the comments this as working fine:

    start "" "%ProgramFiles%\Git\git-bash.exe"
    

    0 讨论(0)
提交回复
热议问题