title: Script to merge 2 git branches automatically?
body: <p>My git repository has 2 branches: master and develop. I want a script that merges all changes from develop to master automatically.</p>
  
  <p>I used Jenkins: The Git plugin clones the repository and then this script (the 'version' variable is a job parameter) is run:</p>
  
  <pre><code># merge
  git checkout -b develop origin/develop
  git checkout master
  git merge -Xtheirs --squash develop -m "v${version}"
  
  # commit
  git commit -m "v${version}"
  
  # tag
  git tag v${version} -m "v${version}"
  
  # push
  git push origin v${version}
  </code></pre>
  
  <p>I tried it on a test repository and it fails with:</p>
  
  <blockquote>
    <p>git merge -Xtheirs develop<br>
    CONFLICT (delete/modify): test.txt deleted in develop and modified in HEAD. Version HEAD of test.txt left in tree.<br>
    Automatic merge failed; fix conflicts and then commit the result.</p>
  </blockquote>
  
  <p><strong>How do I resolve this conflict <em>automatically</em>?</strong> I want the script to always add/modify/delete files according to the 'develop' branch, since master is never touched anyway...</p>