title: Jenkins + Git + Artifactory Release Staging
body: <p>I'm trying out Jenkins release staging functionality with the Artifactory plugin:</p>
  
  <p>Here is a summary of what is happening. Everything is correct except for the error on the last item:</p>
  
  <ul>
  <li>Changes the version in gradle.properties from 1.0.1-SNAPSHOT to 1.0.1</li>
  <li>Builds successfully.</li>
  <li>Deploys artifacts to a local artifactory server</li>
  <li>Creates a git release branch 'REL-BRANCH-1.0.1c'</li>
  <li>Commits the version change in <code>gradle.properties</code>. Pushes it to git server.</li>
  <li>Then Jenkins errors on <code>git checkout master</code>.</li>
  </ul>
  
  <p>This same command works fine on a local clone of the git repo. 'master' is the correct name of the normal dev branch on this test project. I can't imagine why this wouldn't work.</p>
  
  <p>FYI, this is a test project using temporary servers running on my development laptop.</p>
  
  <p>Here is the Jenkins console output:</p>
  
  <pre><code>:my-great-lib:artifactoryPublish
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1-sources.jar
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1.pom
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1.jar
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1-sources.jar
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-app/1.0.1/my-great-app-1.0.1-javadoc.jar
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1.pom
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1-javadoc.jar
  Deploying artifact: http://localhost:8081/artifactory/libs-release-local/org/gradle/sample/my-great-lib/1.0.1/my-great-lib-1.0.1.jar
  Deploying build info to: http://localhost:8081/artifactory/api/build
  
  BUILD SUCCESSFUL
  
  Total time: 6.243 secs
  Build step 'Invoke Gradle script' changed build result to SUCCESS
  [RELEASE] Committing release version on branch 'REL-BRANCH-1.0.1c'
  [RELEASE] Pushing branch 'REL-BRANCH-1.0.1c' to 'ssh://git@localhost:7999/test/atest.git'
  Failure in post build SCM action: Failed checkout branch: Command "git checkout master" returned status code 1:
  stdout: 
  stderr: error: pathspec 'master' did not match any file(s) known to git.
  
  ERROR: [RELEASE] Failed on build completion
  java.io.IOException: Failed checkout branch: Command "git checkout master" returned status code 1:
  stdout: 
  stderr: error: pathspec 'master' did not match any file(s) known to git.
  
      at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234)
      at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199)
      at hudson.FilePath.act(FilePath.java:914)
      at hudson.FilePath.act(FilePath.java:887)
      at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60)
      at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:137)
      at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:674)
      at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:644)
      at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
      at hudson.model.Run.execute(Run.java:1726)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)
  Finished: FAILURE
  </code></pre>