[英]How to `rebase` to avoid duplicated commits on pull request
I git fetch upstream
on my fork. 我在叉上
git fetch upstream
。
[Here starts the stuff I could not understand at all] [这里开始我根本听不懂的东西]
I have a commit
with a pre compiled message: Merge remote-tracking branch 'upstream/master' 我有一条带有预编译消息的
commit
: 合并远程跟踪分支“上游/主服务器”
I pushed to my remote
我推到我的
remote
Continue working on another feature, pushed to remote
and create another Pull Request where have the (3) commits of the old PR, the merge... commit and the (2 last) commits that are relative to this feature. 继续处理另一个功能,将其推送到
remote
并创建另一个“ 拉取请求” ,其中具有旧PR的(3)提交, merge ...提交和与此功能相关的(最后2个)提交。
Here is the PR, where only the last two commits are necessary. 这是PR,仅需要最后两次提交。
As you could see, the owner propose to rebase
but, sincerely, don't know how to solve it the right way. 如您所见,所有者建议重新定
rebase
但真诚的是,不知道如何解决正确的方法。
You could do : 你可以做:
git rebase -i origin/master
(you can change the origin/master to the branch you want to rebase on) (您可以将原点/母版更改为要作为基础的分支)
And then remove the lines of the unnecessary commits in the interactive mode. 然后在交互模式下删除不必要提交的行。 Then save and
git push -f
然后保存并
git push -f
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.