title: Jenkins + Git Publisher - How to push back to {GIT_BRANCH}?
body: <p>I'm using the current version of the Git plugin (SCM provider and Publisher) on Jenkins 1.500.  The SCM polling works fine, using my git HTTP URL and "branches to build" setting of "feature-*".  This picks up changes to any branch, e.g., "feature-1234", runs the build/test/coverage tasks, and reports on success or failure.  All of this works fine, including a merge from the integration branch where the code should end up after a successful build and code review.</p>
  
  <p>The problem is in trying to push the completed build branch BACK to origin, on the same "feature-1234" branch.  The build variable "GIT_BRANCH" in this case contains "origin/feature-1234", which produces the following error and failure in the Git Publisher after an otherwise successful build:</p>
  
  <pre><code>Pushing HEAD to branch origin/feature-1234 at repo origin
  ERROR: Failed to push branch origin/feature-1234 to origin
  hudson.plugins.git.GitException: Command "/usr/bin/git push https://jenkins:jenkinsPWD@myproject.com/git/project HEAD:origin/feature-1234" returned status code 1:
  stdout: 
  stderr: error: unable to push to unqualified destination: origin/feature-1234
  The destination refspec neither matches an existing ref on the remote nor
  begins with refs/, and we are unable to guess a prefix based on the source ref.
  error: failed to push some refs to 'https://jenkins:jenkinsPWD@myproject.com/git/project'
  
      at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:897)
      at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:858)
      at hudson.plugins.git.GitAPI.push(GitAPI.java:915)
      at hudson.plugins.git.GitPublisher$4.invoke(GitPublisher.java:351)
      at hudson.plugins.git.GitPublisher$4.invoke(GitPublisher.java:333)
      at hudson.FilePath.act(FilePath.java:865)
      at hudson.FilePath.act(FilePath.java:838)
      at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:333)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
      at hudson.model.Run.execute(Run.java:1582)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)
  Build step 'Git Publisher' changed build result to FAILURE
  Build step 'Git Publisher' marked build as failure
  </code></pre>
  
  <p>See the extra "origin" in there? <strong>origin/feature-1234</strong>  &lt;== that's the current value of ${GIT_BRANCH}, and while I understand it's a remote branch and all, it's stopping me from running the process we want to follow.</p>
  
  <p>If I'm missing something simple, I'd love to hear it.  But I have tried many different settings for the various git-related portions of my build and nothing seems to allow me to commit the merged and tested code back to the work branch (as opposed to the integration branch, which is easy to do.</p>