git commit - 设置未来的时间戳 [英] git commit - setting timestamps into the future

查看:105
本文介绍了git commit - 设置未来的时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Git进行一些提交,但是我希望git-log中的时间戳将来可以使用。

I need to make some commits using Git but I would like the timestamp in git-log to be in the future.

如何在git中执行提交导致未来的时间戳注册在git-log?

How can I do a commit in git that causes a future timestamp to register in the git-log?

推荐答案

您应该等一下。

或者你可以这样做:

/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!

注意有一个作者日期和一个提交者日期,确保设置正确的一个(或两者)。

Note that there's both an author date and a committer date, so be sure to set the right one (or both).

这篇关于git commit - 设置未来的时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆