Home > front end >  How to get whole list of changes for a previously-merged-to-master branch?
How to get whole list of changes for a previously-merged-to-master branch?

Time:11-10

I have a working branch WB, that I merged to master using PR. Then I reverted those changes in master.

Now if I create a new PR (WB to master), I can't see the whole list of changes, just the last changes for the last commit, and the complete list of commits.

How can I see the whole list of changes?

Thank you

CodePudding user response:

Your situation :

     WB got merged here (through PR)
             |  got reverted here (through another PR maybe ?)
             |     |
             v     v
*--*---*-----M--*--R--* <- master
    \       /
     *--*--* <- WB

As you can see in the diagram above, git now considers that WB, in its current state, has already been merged to master.

You need to choose one way to create something that will bring back the changes you want :

*--*---*-----M--*--R--* <- master
    \       /          \
     *--*--* <- WB      *--* <- newWB (with changes)

One way to create this newWB branch is to "revert the revert" :

  • If the revert was done in one single commit :
# create a new branch starting off master :
git checkout -b newWB master

# re-revert the 'R' commit :
git revert R
# create a new branch starting off master :
git checkout -b newWB master

# revert the merge commit :
git revert -m 1 R

You can now push that new branch and merge it to master.

  •  Tags:  
  • git
  • Related