Dus*_*tin 69
你应该稍等一下.
或者你可以这样做:
/tmp/x 604% env GIT_AUTHOR_DATE='Wed Dec 19 15:14:05 2029 -0800' git commit -m 'future!'
[master]: created 6348548: "Future!"
1 files changed, 1 insertions(+), 0 deletions(-)
/tmp/x 605% git log
Author: Dustin Sallings <dustin@spy.net>
Date: Wed Dec 19 15:14:05 2029 -0800
Future!
Run Code Online (Sandbox Code Playgroud)
请注意,既有作者日期又有提交者日期,因此请务必设置正确的日期(或两者).
Pau*_*ijs 49
你可以修改提交,一个2037年的例子:
git commit --amend --date="Wed Feb 16 14:00 2037 +0100"
Run Code Online (Sandbox Code Playgroud)
我也尝试了2038年,但后来我得到了一个空值.
Hug*_*ugo 10
如果要在将项目添加到git时保留实际更改日期,可以使用
env GIT_AUTHOR_DATE="`ls -rt *.cpp|tail -1|xargs date -u -r`" git commit -m "Old sources retaining old change-dates of last changed
file: `ls -rt *.cpp|tail -1`, actual commit date: `date`"
Run Code Online (Sandbox Code Playgroud)
这将提交最后更改的*.cpp文件的更改日期,以及实际提交日期的一个很好的解释消息.
| 归档时间: |
|
| 查看次数: |
17069 次 |
| 最近记录: |