title: Scripting Git Commands in Windows
body: <p>I have a few git commands I would like to automate in a restrictive windows environment.  I find myself running these same commands over and over, executing in Git Bash.</p>
  
  <pre><code>$ git cd "R:/my/directory/repo"
  $ git pull
  $ git checkout "MyBranch"
  $ git merge "MyOtherBranch"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$ git checkout "MyBranch"
  $ git add .
  $ git commit -m "My commit comments"
  </code></pre>
  
  <p>I'm proficient with JScript, and I know it works in my restrictive windows environment, so what I want to do is to start my day by opening the command prompt and typing</p>
  
  <pre><code>cscript.exe "MyGitRefreshScript.wsf" "MyBranch" "MyOtherBranch"
  </code></pre>
  
  <p>And then on demand, throughout the rest of the day, I can do that, and also use</p>
  
  <pre><code>cscript.exe "MyGitCommitScript.wsf" "MyBranch" "My commit comments"
  </code></pre>
  
  <p>Then I can sit there happily with the command prompt open pressing the up arrow and run those all day long as I do my work.  </p>
  
  <p>I can not install third party applications or tools on my machine, so I am looking to just use JScript inside a .wsf file to accomplish this.  I would also like to be able to see the output messages like I do when running the commands in Git Bash as I do now.  </p>
  
  <p>Something like:</p>
  
  <pre><code>&lt;job id="main"&gt;
      &lt;script language="JScript"&gt;
          var sh = new ActiveXObject("WScript.Shell");
          sh.Run(Git.exe "SomeCommand" ?);
  
          //or
  
          var git = new ActiveXObject("Git");
          git.SomeCommand ???
  
          ...
  </code></pre>
  
  <p>Is this possible, and if so, how? 
  Is there a clear alternative that doesn't involve some third party tool installation?</p>
  
  <p>Thank you</p>