Execute commands from .bat file on Git Bash Terminal

Shabbir Panjesha picture Shabbir Panjesha · Mar 14, 2014 · Viewed 39.4k times · Source

I am newbie to Git bash.

Just out of curiosity trying to make a .bat file which contains commands(Dont know if Git Bash supports .bat file)

What I want to achieve is simply drag and drop this .bat file to Git Bash terminal and commands in the file get executed(Is it possible?).

My commands in .bat file

cd "C:\Users\USER\abc\xyz"
cd "C:\Users\USER\abc\xyz\pqr"
export HOME="C:\Users\USER\some_directory"
export HOME2="C:\Program Files\directoy"

Answer

Michael Freidgeim picture Michael Freidgeim · Aug 19, 2016

You can run batch files just from git bash e.g.

 ./clear.bat 

From Out of a git console: how do I execute a batch file and then return to git console?