3

Say I do git log branch-A..branch-B, I get a list of commits that are in branch-B but not in branch-A. I can also get a list of commits in branch-A but not in branch-B by reversing the order.

Almost every commit into branch-A is cherry-picked into branch-B, however I noticed that git log shows commits that have been cherry-picked. In particular I notice that the commit hash of the cherry-picked commit in branch-B is different from the one that is in branch-A. Does someone know why this could happen? If so how to perform the diff so that it does not capture these false positives?

GXR
  • 95
  • 2
  • 9

1 Answers1

4

In particular I notice that the commit hash of the cherry-picked commit in branch-B is different from the one that is in branch-A

Of course.

git commit store the parent as part of the metadata calculating the SHA-1. Since the parent is different the SHA-1 will be different as well.

enter image description here

CodeWizard
  • 128,036
  • 21
  • 144
  • 167