[英]How to move all commits from a branch to another?
The scenario is this: 场景是这样的:
X1--X2--X3--X4--X5--X6 (master)
\
D1--D2--D3 (dev)
\
B1--B2--B3 (bug1)
I want to move all commits from bug1 branch to master branch and get rid of bug1 branch. 我想将所有提交从bug1分支移动到master分支并摆脱bug1分支。 In this case:
在这种情况下:
X1--X2--X3--X4--X5--X6--B1--B2--B3 (master)
\
D1--D2--D3 (dev)
What's the best option to do this? 这样做的最佳选择是什么?
It should be a classic case of git rebase --onto
它应该是
git rebase --onto
的经典案例
git rebase --onto master dev bug1
git checkout master
git merge bug1 # fast-forward merge
See also the ProGit Book for another example of rebase --onto
. 另请参阅ProGit Book以获取
rebase --onto
另一个示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.