首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Jenkins -在构建时创建Git分支

Jenkins -在构建时创建Git分支
EN

Stack Overflow用户
提问于 2018-10-01 19:22:45
回答 1查看 1.2K关注 0票数 1

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

我有如下的git发布设置:

但是当我运行它时,标记似乎运行得很好,但是分支提供了:

代码语言:javascript
运行
复制
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'

我做错了什么?

EN

回答 1

Stack Overflow用户

发布于 2018-10-01 22:26:18

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

如果你“手动”做这个,你应该告诉git使用remote/RELEASE-ID作为上游。Jenkins接口不允许您定义这样的行为。也许你可以用一个脚本来实现类似的功能。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52590018

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档