Git: parent commit is younger than descendant?
git
Solution
As mentioned in the comments:
- you put any timestamp you want on a commit: "git commit - setting timestamps into the future"
- you can amend the timestamp of a commit: "How can one change the timestamp of an old commit in Git?"
- You are dealing with two dates: `GIT_AUTHOR_DATE` and `GIT_COMMITER_DATE`: See working with date in Git.
What you see could be the result of a:
- rebase, since `git rebase` does actually not change authors' timestamps by default: see "git rebase without changing commit timestamps".
- cherry-picking (as commented by Michael Anderson) since it also preserves `GIT_AUTHOR_DATE`
Problem
I was browsing http://arago-project.org/git/projects/linux-omap3.git repo and came across a strange date-thing, which basically says that parent commit is a year younger than its child. How is this possible? ``` user@ubuntu1004:/f/linux-omap3$ git log -2 --parents 4b8db3b commit 4b8db3b368f5601717e3ffee0051628ba33172d3 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 Author: Kevin Hilman <khilman@deeprootsystems.com> Date: Fri Aug 20 11:19:52 2010 -0700 OMAP: bus-level PM: enable use of runtime PM API for suspend/resume [...skipped...] Cc: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> commit 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 65f42886e24be2197b1263f138eabf40c6774d00 Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Tue Jan 4 16:50:19 2011 -0800 Linux 2.6.37 ```