Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine the date of GIT cherry pick?

Tags:

git

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

like image 670
Qwerty Avatar asked Nov 17 '14 12:11

Qwerty


People also ask

How do I check my cherry-pick commits?

In order to cherry-pick changes, you will need to identify your commit hashes. In order to see the commit hashes for your current branch, simply run the “git log” command with the “–oneline” option in order to make it more readable.

Does git cherry-pick preserve history?

According to the Git docs the action of the git cherry-check command is to "Apply the changes introduced by some existing commits". Notice the use of the phrase apply changes rather than merge changes. Cherry picking will not preserve history exactly how it is represented from the source.

How does cherry-pick work in git?

git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD. Cherry picking is the act of picking a commit from a branch and applying it to another. git cherry-pick can be useful for undoing changes.

Does cherry-pick order matter?

Absolutely, commit order matters. If commit B modifies stuff that was first introduced in commit A, then you can't apply commit B until commit A has been applied.


1 Answers

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.

like image 56
patthoyts Avatar answered Oct 01 '22 01:10

patthoyts