title: How do I push to git from Jenkins?
body: <p>The following code is an "Execute Shell" build step in Jenkins. The job pulls from a repo which contains a file <code>ranger-policies/policies.json</code>. What I'd like to do is update that file (with a curl command, in this case) and then commit the change to source control and update the remote repo. The job successfully pulls from the remote repo in the "Source Code Management" section of the job configuration page over SSH using SSH keys. However, when the job gets to the "git push origin master" line in the "Execute Shell" step, I get a <code>Permission denied (publickey)</code> error, as if those same SSH keys which allowed me to successfully pull the repo are not available in the "Execute Shell" step when I want to push.</p>
  
  <pre><code>curl -X GET --header "text/json" -H "Content-Type: text/json" -u user:pass "http://my-url.com/exportJson" &gt; ranger-policies/policies.json
  
  git add ranger-policies/policies.json
  git commit -m "udpate policies.json with latest ranger policies `echo "$(date +'%Y-%m-%d')"`"
  git push origin master
  </code></pre>