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
I prefer, putting git in environment variable and just calling
c:\Users\[myname]>sh
or
c:\Users\[myname]>bash
Steps to create Environment variable (Win7)
In the section User variables, hit button NEW, put variable name as GIT_HOME
, value as (folder-where-you-installed-git).
c:\tools\git
, others maybe have C:\Program Files\Git
find the PATH
environment variable and select it. Click Edit. (If the PATH environment variable does not exist, click New).
%GIT_HOME%
and %GIT_HOME%\bin
. Click OK. Close all remaining windows by clicking OK.sh
or bash
or git-bash
start "" "%SYSTEMDRIVE%\Program Files (x86)\Git\bin\sh.exe" --login -i
Git bash will get open.
You can add git path to environment variables
%SYSTEMDRIVE%\Program Files (x86)\Git\bin\
%PROGRAMFILES%\Git\bin\
Open cmd and write this command to open git bash
sh --login
OR
bash --login
You can see this GIF image for more details:
https://media1.giphy.com/media/WSxbZkPFY490wk3abN/giphy.gif