我是Git项目的维护者。有时新贡献者发送基于较旧提交的补丁,因为他们忘记在提交之前将最新更改和rebase重新绑定到Git master。我可以为他们做这件事,但需要很多步骤。我怎么能一步到位呢?
我如何分多步完成:
git checkout -b feat/some-patch <commit id of commit he based his patch on>
git pull <his patch> # applies via fast-forward
git rebase master # do what he should have done
git checkout master
git merge feat/some-patch # applies via fast forward
这有效,我避免了合并提交。 我希望有一个班轮这样做。我看了git pull --rebase,但它并没有达到我的预期。