1

How can you find out which commit was used in a cherry-pick operation? git reflog only seems to show the resulting commit Sha-1 after the cherry-pick is merged and commited. We need to find the original commit prior to that.

Why? It's because we mistakenly cherry-picked a large, but incorrect commit to a different branch. But noone realized it until after modifying it so that it compiles plus added other commits after it.

The goal here is to compare this resulting cherry-pick from the original one and use those differences either as a patch or to manually make the same changes to the correct cherry-pick.

Wayne
  • 2,959
  • 3
  • 30
  • 48
  • Why can't you just diff the cherry-picked commit with its parent? – amcnabb Mar 23 '12 at 17:07
  • See also: [which commits got cherry-picked](http://stackoverflow.com/q/11719926/456814). –  Apr 24 '14 at 17:59
  • This is a duplicate of http://stackoverflow.com/questions/2922652/git-is-there-a-way-to-figure-out-where-a-commit-was-cherry-picked-from – Loic Dachary Feb 14 '15 at 22:43
  • Does this answer your question? [Git: Is there a way to figure out where a commit was cherry-pick'ed from?](https://stackoverflow.com/questions/2922652/git-is-there-a-way-to-figure-out-where-a-commit-was-cherry-picked-from) – Inigo Dec 19 '21 at 23:39

1 Answers1

0

You can compare the git log -p output. You may be able to do it with --stat as well.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141