How to PR and merge again after reverting PR using Github Revert Button

后端 未结 4 1532

Basically I used Github revert button to revert a previous PR for a feature branch into master, then I decided to merge the same feature br

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 07:53

    The reason you can't auto merge back in is because the base of the branch is out of sync with the HEAD of the master branch.

    Reverting the Revert can get messy and sometimes lacks transparency.

    Furthermore, reverting a revert will prevent other branches with this code from merging correctly.

    Lets say you have feature x on master and merged into branch y. then you decide master shouldn't have had feature x merged in yet as it depends on branch y. So, you revert on master. When you try to merge branch x, git-merge command sees the original merge, and happily announces that all is well and branches have been already merged, omitting these commit for feature x, even though you wanted them merged with branch y.

    You should pull the most recent master, rebase your branch on master and then you should be able to make another pull request.

提交回复
热议问题