git - Jenkins - 在构建时创建 Git 分支
问题描述
我有一个 Jenkins 构建,完成后我希望在远程存储库中为发布创建一个分支。
但是当我运行它时,标记似乎没问题,但是分支给出了:
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'
我究竟做错了什么?
解决方案
您正在将本地 RELEASE-ID 分支推送到远程,但问题是由于它是一个新创建的分支,它没有定义上游,因此 git 不知道将提交推送到哪里。
如果您“手动”执行此操作,您会告诉 git 使用 remote/RELEASE-ID 作为上游。Jenkins 界面不允许您定义此类行为。也许你可以用脚本实现类似的东西。
推荐阅读
- python - 熊猫:df['A'] == df['B'] 或 df['B'] == [] 的行数
- google-colaboratory - Google Colab 文件资源管理器用户界面
- jq - JQ如何将异构对象组合成一个数组?
- python - 如何将多个 excel 行放入一个带有子列表的大列表中?
- python - 优雅地关闭线程套接字服务器
- c# - Linq 查询在 ASP.NET-Core 3.0 及更高版本中对数字等字符串进行排序
- php - WooCommerce API 创建订单而不链接到产品/变体
- python - 使用装饰器获取函数的父类名
- c - 如何编写一个函数,该函数采用一个数字数组返回一个用 C 中的空格分隔的字符串?
- c++ - RcppEigen 包错误:不适用于包的 .Call()