What do I do when a pull request is cherry picked?

半城伤御伤魂 提交于 2019-12-06 03:40:19

The simplest thing to do is just always work on topic branches. That way your forks master branch always looks like upstream so that once upstream includes your changes you always do the same thing, just delete your topic branch.

If upstream merges your changes, your master and topic branch both contain the same commits and you can safely delete the topic branch. If upstream cherry-picks your commits then after verifying the changes made it to upstream you can just delete the topic branch.

The other major benefit of this is that you can easily rebase your topic branch against master. Sometimes if a patch cannot be applied upstream without manual conflict resolution they will ask you to rebase or merge and do the conflict resolution yourself, since its your code and you know more about it. I also suspect they cherry-picked your commit because they had commited after you made the fork and did not want to introduce a merge commit for only a small amount of commits. By cherry-picking they kept their history more linear and cleaner. If you had rebased often, it might have only been a fast-forward merge for them and they wouldn't need to cherry-pick.

As for your question of what to do right now, force updating your local branch and then force pushing back to your fork is the only real option you have.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!