简体   繁体   English

Git:Feature分支的纯合并

[英]Git: Pure merges of Feature branches

I have the following case: 我有以下情况:

mainline ---x----NNN-----x---------
            |            |
            |   feature  yyyyyyyy
release     x ----------------------x

I like to have the feature branch in the release branch. 我喜欢在发布分支中具有功能分支。 But I like to have it "pure", meaning I do not like to have the commits NNN in the release yet. 但是我喜欢让它“纯净”,这意味着我不喜欢在发行版中拥有NNN提交。

One option would be to create a new branch and do a rebase --onto 一种选择是创建一个新分支并重新设置--onto

git branch feature_for_release feature
git rebase --onto release mainline feature_for_release
git checkout release
git merge feature_for_release
git branch -d feature_for_release

But I do not like to create new branches just for a merge and the method is pretty lengthy. 但是我不喜欢仅为合并创建新分支,而且该方法相当冗长。

Is there a solution like this? 有没有这样的解决方案?

git checkout release
git merge feature --without mainline

您可以从功能分支中挑选一系列提交到发布分支中。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM