如何用过去的日期创建一个git commit? [英] How to create a git commit with date in the past?
问题描述
我已经搜索过了,据我了解,可以使用 git commit --date
如果有人能够澄清这一点并举例说明日期格式,我将非常感激。 / p>
例如 来自kernel.org: DATE FORMATS GIT_AUTHOR_DATE,GIT_COMMITTER_DATE环境变量和 Git内部格式其中 RFC 2822标准电子邮件格式,如RFC 2822所述,用于 ISO 8601 ISO 8601标准规定的时间和日期,例如 来源: http://www.kernel.org/pub/software/scm/git/docs/ git-commit.html I wonder how would you create a commit in the past? I've searched for it, and as far as I understand one can use I would really appreciate if someone could clarify this and give an example of the date format. For example From kernel.org: DATE FORMATS The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables and the
Git internal format It is , where
is the number of seconds since the UNIX epoch.
is a positive or negative offset from UTC. For
example CET (which is 2 hours ahead UTC) is +0200. RFC 2822 The standard email format as described by RFC 2822, for
example Thu, 07 Apr 2005 22:13:13 +0200. ISO 8601 Time and date specified by the ISO 8601 standard, for example
2005-04-07T22:13:13. The parser accepts a space instead of the T
character as well. source: http://www.kernel.org/pub/software/scm/git/docs/git-commit.html 这篇关于如何用过去的日期创建一个git commit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! - date =Wed Feb 16 14:00 2011 +0100$
$ b
- date
选项支持以下日期格式:
是自UNIX纪元以来的秒数。
是与UTC的正数或负数偏移量。对于
示例,CET(即UTC提前2小时)为+0200。
例子Thu,2005年4月7日22:13:13 +0200。
2005- 04-07T22:13:13。解析器也接受一个空格而不是T
字符。
git commit --date""
--date="Wed Feb 16 14:00 2011 +0100"
--date
option support the following date formats: