Jenkins-在构建中创建Git分支

时间:2018-10-01 11:22:45

标签: git jenkins

我有一个Jenkins版本,完成后我希望在远程存储库中为该版本创建一个分支。

我有这样的git publish设置: enter image description here

但是当我运行它时,标记似乎可以,但是分支给出了:

ERROR: Failed to push branch RELEASE-5 to jsched
 hudson.plugins.git.GitException: Command "git.exe push 
 https://myid@git.server:9443/scm/win/jsched.git HEAD:RELEASE-5" returned status code 1:

 stderr: error: unable to push to unqualified destination: RELEASE-5
  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://myid@git.server:9443/scm/win/jsched.gitt'

我在做什么错了?

1 个答案:

答案 0 :(得分:1)

您正在将本地RELEASE-ID分支推送到远程,但是问题在于,由于它是新创建的分支,因此没有上游定义,因此git不知道将提交推送到何处。

如果您在“手动”执行此操作,您将告诉git使用remote / RELEASE-ID作为上游。 Jenkins界面不允许您定义此类行为。也许您可以使用脚本来实现类似的目的。