简体   繁体   English

单独构建分支,并根据请求请求合并到主节点

[英]Build branch separately and merge into master on pull request

Currently I have a Webhook from my Git platform to Jenkins such that every time a pull request is made, the master is built. 目前,我有一个从Git平台到Jenkins的Webhook,以便每次发出拉取请求时,都会构建主数据库。

I would like: 我想要:

1.Build the branch with the changes. 1.使用更改构建分支。

2.Merge the branch with master and build master. 2.将分支与master合并并构建master。

In the project configuration, under " Source Code Management " and " Branch Specifier ", I filled in: 在项目配置中,在“ 源代码管理 ”和“ 分支指定符 ”下,填写:

master

In this case only the master branch is built, but not the one with changes. 在这种情况下,仅构建主分支,而不构建具有更改的分支。

When I leave the option blank, all the branches are built, instead of just the one with changes and master. 当我将该选项留为空白时,将构建所有分支,而不仅仅是具有更改和主分支的分支。

Merge before build functionality of Git Plugin solves exactly this issue. Merge before buildGit插件 Merge before build功能可以解决此问题。

On your job leave the Branch Specifier blank. 在您的工作中,将“ Branch Specifier留空。 Then on Additional Behaviours choose Merge before build and set master as Branch to merge to , so your branch with the changes will be merged into master prior the build. 然后在“ Additional Behaviours选择“ Merge before build ,并将master设置为Branch to merge to ,这样您所做的更改将在构建之前合并到master中。

If you then want this merge to be pushed to your repository, choose on the Post-Builds the Git Publisher and configure it as you prefer. 如果您随后希望将此合并推送到您的存储库,请在Post-BuildsGit Publisher选择,并根据需要进行配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将master合并为作为pull request提交的分支? - How to merge master into branch submitted as pull request? 拉请求插件将master合并到分支 - Pull request plugin to merge master into branch Github:提交拉取请求后将 `master` 分支合并到 `feature` 分支 - Github: Merge `master` branch into `feature` branch after submiting pull request 在拉取请求之前强制将基础/合并母版转移到功能分支 - Force rebase/merge master to feature branch before pull request 拉取请求合并冲突问题 - 不显示当前主分支数据 - Pull Request merge conflict issues - Not showing current master branch data 在vNext中的Pull Request构建期间,如何推导合并目标分支? - How to deduce the merge target branch during the Pull Request build in vNext? 无法创建提取请求以将功能分支合并到新创建的存储库中的master分支中 - Can't create a pull request to merge a feature branch into a master branch in a newly created repository 如何在GitHub中创建从一个分支的Bitbucket到master分支的合并拉取请求 - How to create merge pull request from Bitbucket of one branch to master branch in GitHub 当该分支上有一个开放的拉取请求时,我可以将我的分支与主分支合并吗? - Can I merge my branch with the master while there is an open pull request on that branch? 合并拉取请求到不同的分支 - Merge pull request into different branch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM