title: how to checkout specific tag/commit (git) with Jenkins pipeline
body: <p>till now I ran the follwoing command in jenkins:</p>
  
  <pre><code>git branch: branch_nam, url: url, credentialsId: cred
  </code></pre>
  
  <p>and it works fine.
  I've tried to add a way to checkout specific tag/commit so I've used the follwing command:</p>
  
  <pre><code>checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: url]], branches: [[name: tag]]], credentialsId: cred, poll: false
  </code></pre>
  
  <p>but I get the following error:</p>
  
  <blockquote>
    <p>ERROR: Error cloning remote repo 'origin'
    hudson.plugins.git.GitException: Command "git fetch --tags --progress
    <a href="http://codefront:8080/tfs/DefaultCollection/some_folder" rel="nofollow noreferrer">http://codefront:8080/tfs/DefaultCollection/some_folder</a>
    +refs/heads/<em>:refs/remotes/origin/</em>" returned status code 128: stdout:  stderr: fatal: Authentication failed for
    <a href="http://codefront:8080/tfs/DefaultCollection/some_folder" rel="nofollow noreferrer">http://codefront:8080/tfs/DefaultCollection/some_folder</a></p>
  </blockquote>
  
  <p>what did I do wrong?
  what is the difference between they way each command works?</p>
  
  <p>Thanks in advance </p>