19

Suppose I:

  1. Pushed some file to branch A.
  2. Cherry picked the commit from branch A to branch B.

Once I enter git log -1 on branch B, I can see that the date is the original one in which the file was pushed to branch A.

So how can I determine the cherry pick date?

Thanks,

Qwerty

Qwerty
  • 748
  • 1
  • 9
  • 25

2 Answers2

23

A git commit has two dates. One is the author date and the other is the commit date. The default display is the author date. You want the commit date. git log -1 --pretty=fuller will show that or you can use %cD in a log format.

patthoyts
  • 32,320
  • 3
  • 62
  • 93
1

You can force both the author date and the commit date of a cherry-picked commit using something like

% GIT_AUTHOR_DATE='<desired author date>' GIT_COMMITTER_DATE='<desired committer date>' git cherry-pick <your commit hash>

This answer details the formats that you can use for the two date parameters.

palimpsestor
  • 1,038
  • 1
  • 8
  • 28