5

How to list commits that were cherry-picked in Git? Let's suppose the following scenario: cp = cherry-pick commit

                         cp1         cp2          
master -----o------o------o-----o----o
            \            /          /
     branch1 \----o------o-----o---o---o

Is there a log command to list cherry-pick commits cp1 and cp2 ?

Thanks.

Michael
  • 1,502
  • 19
  • 29
user2620348
  • 309
  • 4
  • 15

2 Answers2

9
git cherry -v branch1 master

See git-cherry for documentation.

Michael
  • 1,502
  • 19
  • 29
  • If you reverse the branches in the command above, `git cherry -v master branch1`, then you will see the new commit hash generated by cherry picking. – Jose Quijada Dec 08 '20 at 14:09
1
git reflog

will show cherry-pick events.

Jordan Samuels
  • 977
  • 6
  • 10
  • This only works locally. See [this question](https://stackoverflow.com/questions/10098095/git-can-i-view-the-reflog-of-a-remote) for more information. – jotik Aug 11 '14 at 17:26
  • @jotik agree. I don't believe the information is available except in the reflog, since remotely it's just another commit, right? – Jordan Samuels Aug 11 '14 at 17:59
  • Correct. I don't know whether the remote (usually bare) repository has a reflog, but if it does, it's most likely not identical to the local reflog. – jotik Aug 11 '14 at 18:58
  • Thanks for responses. Reflog is what I am lokking for partially, but I need that information from the remote side, since I need that information in a Hook pre-recieved of the remote so I can so some actions with pushed cherry-picked commits. Is there no any way from the remote? Thanks. – user2620348 Aug 14 '14 at 14:25