我正在浏览 http://arago-project.org/git/projects/linux-omap3.git repo 并遇到一个奇怪的约会对象,它基本上说父提交比它的 child 小一岁。
这怎么可能?
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
最佳答案
如评论中所述:
- 您可以在提交上放置您想要的任何时间戳:“git commit - setting timestamps into the future ”
- 您可以修改提交的时间戳:“How can one change the timestamp of an old commit in Git?”
- 您正在处理两个日期:
GIT_AUTHOR_DATE
和GIT_COMMITER_DATE
:参见 working with date in Git .
您看到的结果可能是:
- rebase,因为
git rebase
默认情况下实际上不会更改作者的时间戳:请参阅“git rebase without changing commit timestamps”。 - cherry-picking (作为 commented by Michael Anderson )因为它还保留了
GIT_AUTHOR_DATE
关于Git:父提交比后代年轻?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12934044/