我正在浏览http://arago-project.org/git/projects/linux-omap3.git http://arago-project.org/git/projects/linux-omap3.gitrepo 并遇到了一个奇怪的日期问题,它基本上表示父提交比其子提交年轻一年。
这怎么可能?
user@ubuntu1004:/f/linux-omap3$ git log -2 --parents 4b8db3b
commit 4b8db3b368f5601717e3ffee0051628ba33172d3 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5
Author: Kevin Hilman <[email protected] /cdn-cgi/l/email-protection>
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 <[email protected] /cdn-cgi/l/email-protection>
Signed-off-by: Kevin Hilman <[email protected] /cdn-cgi/l/email-protection>
commit 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 65f42886e24be2197b1263f138eabf40c6774d00
Author: Linus Torvalds <[email protected] /cdn-cgi/l/email-protection>
Date: Tue Jan 4 16:50:19 2011 -0800
Linux 2.6.37
正如评论中提到的:
- 你可以在提交上添加任何你想要的时间戳:“git commit - 设置未来的时间戳 https://stackoverflow.com/questions/367262/git-commit-setting-timestamps-into-the-future"
- 您可以修改提交的时间戳:“如何更改 Git 中旧提交的时间戳? https://stackoverflow.com/questions/454734/how-can-one-change-the-timestamp-of-an-old-commit-in-git"
- 您正在处理两个日期:
GIT_AUTHOR_DATE
and GIT_COMMITER_DATE
: See 在 Git 中处理日期 https://stackoverflow.com/questions/2973996/git-rebase-without-changing-commit-timestamps.
您所看到的可能是以下结果:
- 变基,因为
git rebase
默认情况下实际上不会更改作者的时间戳:请参阅“git rebase 而不改变提交时间戳 https://stackoverflow.com/questions/2973996/git-rebase-without-changing-commit-timestamps".
-
采摘樱桃 http://git-scm.com/docs/git-cherry-pick (as 评论了 https://stackoverflow.com/questions/12934044/git-parent-commit-is-younger-than-descendant/12951228#comment17556377_12951228 by 迈克尔·安德森 https://stackoverflow.com/users/221955/michael-anderson)因为它还保留了
GIT_AUTHOR_DATE
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)