I have several git commands that I would like to automate in a restrictive Windows environment. I run these same commands over and over again by executing the git Bash command.
$ git cd "R:/my/directory/repo" $ git pull $ git checkout "MyBranch" $ git merge "MyOtherBranch"
and
$ git checkout "MyBranch" $ git add . $ git commit -m "My commit comments"
I understand JScript and I know that it works in my restrictive Windows environment, so I want to start my day by opening a command prompt and typing
cscript.exe "MyGitRefreshScript.wsf" "MyBranch" "MyOtherBranch"
And then on demand, for the rest of the day, I can do this, and also use
cscript.exe "MyGitCommitScript.wsf" "MyBranch" "My commit comments"
Then I can sit there happily with a command prompt, pressing the up arrow and starting it all day when I do my work.
I cannot install third-party applications or tools on my machine, so I just want to use JScript inside the .wsf file to execute this. I would also like to see the output messages, as I do when I execute commands in git Bash, as now.
Sort of:
<job id="main"> <script language="JScript"> var sh = new ActiveXObject("WScript.Shell"); sh.Run(Git.exe "SomeCommand" ?);
Is it possible, and if so, how? Is there a clear alternative that is not related to installing third-party tools?
thanks
source share