title: Jenkinsfile to checkout multiple branches
body: <p>Currently our Jenkinsfile has the <code>checkout scm</code> step. This results in only one detached head branch:</p>
  
  <pre><code>$ git branch
  * (HEAD detached at 174e48797a)
  </code></pre>
  
  <p>Is there a way we can go a proper fetch to get multiple branches checked out?</p>
  
  <pre><code>$ git branch
  * dev
    master
    testing
  </code></pre>
  
  <p>We would like to do processing in our pipeline to compare differences between the dev and testing/master branches</p>
  
  <p>Additionally, we use the BitBucket git plugin so the access token is store in Jenkins credentials</p>