Github PR shows file changes that are already there in the branch

65 Views Asked by At
  1. There exist a develop branch and feature1 branch that were in sync
  2. Then, I committed a few changes in the develop branch, by mistake (3 commits to be precise)
  3. I then switched to feature1 branch and cherry picked the few changes (3 commits).
  4. Then i made a few changes in the feature1 branch ( 1 new commit).
  5. I Created a PR for merging feature1 into develop (feature1 ===>> develop).

The Files Changed section of the pr now shows changes that i had cherry picked ( the changes in the 3 commits). But develop already has those changes. I evidently cherry picked the changes from develop itslef. Then why does a pr show chages that are already present in the branch that i cherry picked from.

enter image description here

Possible Reason

Is it because cherry pick creates a new commit hash. Github compares the branches by commit hash and since it finds a new hash It just shows the changes done in the new hash

An answer on Microsoft develop community also shows, How github compares two branches?

0

There are 0 best solutions below