title: git commit and push via batch file on Windows
body: <p>I do same task often of committing and pushing changes to remote branch. Being lazy sometimes, I needed to put set of git commands to automatically perform these steps:</p>
  
  <pre><code>cd D:\wamp\www\projectName
  git checkout dev
  git add .
  git commit -am "made changes"
  git push
  pause
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>cd D:\wamp\www\projectName
  call git checkout dev
  call git add .
  call git commit -am "made changes"
  call git push
  pause
  </code></pre>
  
  <p>and</p>
  
  <pre><code>cd D:\wamp\www\projectName
  git.exe checkout dev
  git.exe add .
  git.exe commit -am "made changes"
  git.exe push
  pause
  </code></pre>
  
  <p>Everything works excpet for the final <code>push</code> command. Here is output:</p>
  
  <pre><code>D:\wamp\www\givingcircle&gt;git checkout dev
  Already on 'dev'
  Your branch is ahead of 'origin/dev' by 1 commit.
  
  D:\wamp\www\givingcircle&gt;git add .
  
  D:\wamp\www\givingcircle&gt;git commit -am "made changes"
  # On branch dev
  # Your branch is ahead of 'origin/dev' by 1 commit.
  #
  nothing to commit, working directory clean
  
  D:\wamp\www\givingcircle&gt;git push
  Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  
  D:\wamp\www\givingcircle&gt;pause
  Press any key to continue . . .
  </code></pre>
  
  <p>As you can see, for <code>push</code>, I am getting:</p>
  
  <pre><code>D:\wamp\www\givingcircle&gt;git push
  Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  
  <p>When I run above commands via git shell itself, everything works fine. I have also added git to Windows Path env variables.</p>
  
  <p>Does anyone have an idea of why it works on git shell and not on batch command ? (even though other commands work but not <code>push</code>)</p>