简体   繁体   English

如何将功能分支中的最后一次提交放回顶部,然后与发布合并?

[英]How to put the last commit in the feature branch back on top and then merge with release?

Working with gitlab My last commit for Feature1 was 16267a. 使用gitlab我对Feature1的最后一次提交是16267a。 Then I tried to merge with release using some automatic tools, rebase… Maybe I did something wrong, as a result the top of my Feature1 branch does not have my changes at all. 然后,我尝试使用一些自动工具与发行版合并,重新设置基础……也许我做错了,结果是Feature1分支的顶部根本没有任何更改。

How to put 16267a on top again and then merge with release? 如何再次将16267a放在顶部,然后与发布合并?

As always, pretty sure there are multiple ways to accomplish what you want but one example could be: $RELEASE would be the name of the release branch 与往常一样,可以肯定有多种方法可以完成所需的工作,但一个示例可能是:$ RELEASE将是发行分支的名称。

  1. git checkout $RELEASE
  2. git checkout -b fixed_branch
  3. git cherrypick 16267f34

At this point, your fixed_branch should be up to date with release and your commit in top of it - ready to merge to $RELEASE . 在这一点上,您的fixed_branch应该是最新的release版本,并且您的提交位于它的顶部-准备合并到$ RELEASE If you want the merge to be from same branch name as your previous one was called, you just need to rename it or delete completely first before creating a new branch with the old name 如果希望合并与上一个分支使用相同的分支名称,则只需重命名它或先完全删除,然后再使用旧名称创建新分支即可。

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

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