有没有一种方法可以将一个分支 rebase 到另一个分支,同时跳过另一个分支上的特定(冲突)提交?
例如,我想将 mybranch
rebase 到 master
上,但是 master 包含一个与 master 中的提交冲突的提交,所以我更愿意完全撤消该提交.
-o-o-o-o-o-x-o-o-o-o master
|
o-o-o-o mybranch
x 标记冲突提交。
最佳答案
使用交互式 rebase :
git rebase -i master
将打开一个编辑器,您将看到这样的提交列表:
pick b8f7c25 Fix 1
pick 273b0bb Fix 2
pick 6aaea1b Fix 3
只需删除您要跳过的提交即可。将您的分支 rebase 到 master 时,它将被省略。
P.S. 如果看不到编辑,请引用这个问题解决:How can I set up an editor to work with Git on Windows?
关于git - 如何在跳过特定提交时 rebase ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12604824/