title: How to set git branch for a Jenkins job with groovy
body: <p>I am looking for a way to create multiple projects using Groovy. It is expected that the number of builder on our Jenkins will grow wildly.</p>
  
  <p>I've already a simple mechanism to read a JSON file and create the other projects. However, I am stuck on process to configure Git information on this projects.</p>
  
  <p>I've did this:</p>
  
  <pre><code>def repository = 'my repo....'
  job.scm = new hudson.plugins.git.GitSCM(repository)
  </code></pre>
  
  <p>But, with this GitSCM constructor I can only set the repository, but none o other configuration.
  And I didn't find another way to set each configuration.</p>
  
  <p>Someone know how can I set: branch, credentials, etc.</p>
  
  <p>Thanks!</p>