Reputation: 1959
I have reverted a pull request from GitHub by following this article https://help.github.com/articles/reverting-a-pull-request/. Now even after reverting when I am comparing the two branch it shows same. How can I raise a pull request again?
Here is what I did
What I did wrong and how I can make release/13.0.0 to same state as before?
Upvotes: 6
Views: 5333
Reputation: 197
Revert will create a new commit that undoes the specified commit. It doesn't remove the specified commit, it just creates a new commit on top of your commit to remove your changes. That's why when you check diff between the branch there will be none because the commit is already present in the branch.
For eg:
Branch A => commit1 => commit2 => commit3
after reverting, commit order will be
Branch A => commit1 => commit2 => commit3 => commit4(this is your revert commit)
Upvotes: 1
Reputation: 19035
Since the merge you reverted will always be in the history, you'll need to replay that merge onto prod_bug_fix before submitting your new PR.
First, get prod_bug_fix up to date by checking it out and doing git merge **release/13.0.0**
(this will probably be a simple fast forward merge).
Now let's say that the merge you reverted had hash abc123
; you would replay all the changes to that merge onto prod_bug_fix with git cherry-pick -m 1 abc123
. The -m 1
tells git "replay the changes that were made to the first parent of the merge (release/13.0.0) as opposed to the changes made to the second parent (prod_bug_fix). Once you have done this, a PR from prod_bug_fix to release/13.0.0 will work as expected.
Upvotes: 0
Reputation: 171
A little late on this answer, but I encountered this issue myself and finally tracked down that the revert behaves weirdly in that the original commit being reverted is still in the history, so when you go to create a new PR it still thinks it is in there so you see no difference when doing the diff. This StackOverflow answers gives some more details about it.
Upvotes: 2