title: How to perform a git merge in a Jenkins pipeline?
body: <p>When Jenkins builds a non-master git branch, I want to merge in master automatically at a specific point. I don't want to use the git plugin's auto merge feature.</p>
  
  <p>However, I've added the stage:</p>
  
  <pre><code>stage('Merge master') {
    sh 'git merge master'
  }
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>merge: master - not something we can merge
  </code></pre>
  
  <p>Jenkins seems to be checking out my branch in a weird way that prevents me being able to then merge master. What do I need to do to merge master into my branch?</p>