This question already has an answer here:
-
How To Launch Git Bash from DOS Command Line?
8 answers
I want to create a bat script that do the following :
Context: I am working on an idea, that I will access git-bash through java.
I use Netbeans IDE
You don't have to open git bash at all to execute a sequence of git commands in a script:
Create your bash script as any other script:
#!/bin/bash
git ...
#other commands
Save it as git-myscript
(no extension) anywhere referenced by your $PATH
or %PATH%
(this works even on Windows)
Run it with git myscript
: it will be executed by the git bash.
This work for any file named git-xxx
: you can call that file as a bash script with git xxx
.
(on Linux, Mac or Windows)