如何将旧提交从公共部门转移到另一个分支?
问题是我们要从我们的 public 开发分支机构中发行,但在此之前,我们想从该分支中删除属于尚未准备好发布并将其移至另一个功能的功能的旧提交。分支。
我在stackoverflow上找到了解决分支本身并删除提交的解决方案,但是我认为这会导致我们很多合并问题,因为它将创造出所有其他旧的旧提交,而我们的发展分支机构公开活跃并不断被多人更新。
我们如何才能实现这一重写历史记录的最小历史并尽可能至少合并冲突?
我想到自己的一个想法:
- 的备份分支
- 结帐来自开发恢复功能
- 在开发核对核对功能分支
- 中,从备用分支到特征分支,樱桃挑选了恢复的提交。我认为这将创建新的提交,并再次“重新转换”更改。
- 当功能分支上的开发完整时,重新恢复并合并回开发分支,
我尚未对此进行测试,但是您认为这会起作用吗? 还是您建议任何更好的解决方案?
The issue is we want to make a release from our public develop branch but before that we want to remove old commits from this branch belonging to a feature which is not yet ready to be released and move them to another branch.
I found solutions on StackOverflow that rebase the branch on itself and removes the commits, but i assume this would cause us a lot of merge issues because it would create whole new commits in place of all the other old ones and our develop branch is publicly active and being constantly updated by multiple people.
How can we achieve this rewriting as least history and causing as least merge conflicts as possible?
One idea I have thought of myself:
- checkout a backup branch from develop
- revert feature commits on develop
- checkout a feature branch from develop
- cherry-pick the reverted commits from backup branch to the feature branch. I assume this would create new commits and 'unrevert' the changes again.
- when development on feature branch is finnally complete, rebase and merge back into develop branch
I haven't tested this yet, but do you think this would work?
Or can you suggest any better solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论