在我拉取代码之前,我的本地仓库是这样的:
[my commit 3] <- to be pushed
[my commit 2] <- already pushed
[my commit 1]
因为存在冲突,所以我进行了拉取并执行了合并操作,随后在本地提交了修改:
[merge commit] <- created that by resolving conflicts
[new commit from coworker] <- pulled that
[my commit 3]
[my commit 2]
[my commit 1]
现在我的问题是如何摆脱顶部的合并提交。我认为它应该看起来像这样:
[my commit 3]
[new commit from coworker]
[my commit 2]
[my commit 1]
我该如何进行类似的变基操作?
git fetch
,然后使用git rebase [同事的新提交]
将你的提交放在他们的上面。 - Amber