根据需要创建一个rebase_instead_of_merge
带有历史记录的新分支:
git checkout <commit_hash_for_b> # checkout the last commit of branch 1
git branch rebase_instead_of_merge
git cherry-pick <commit_hash_for_c> # cherry-pick all commits of branch 2
覆盖远程分支origin/some-feature
以指向与新分支相同的提交rebase_instead_of_merge
。在执行此操作之前,请确认覆盖遥控器上的历史记录不会对其他人造成同步问题。
git push --force origin rebase_instead_of_merge:some-feature
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句