gpt4 book ai didi

git - 如何创建过去日期的 git 提交?

转载 作者:太空狗 更新时间:2023-10-29 14:33:29 25 4
gpt4 key购买 nike

我想知道你过去会如何创建提交?

我已经搜索过了,据我所知可以使用 git commit --date""

如果有人能澄清这一点并举例说明日期格式,我将不胜感激。

最佳答案

例如 --date="Wed Feb 16 14:00 2011 +0100"

来自 kernel.org:

DATE FORMATS

The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables and the --date option support the following date formats:

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.

来源:http://www.kernel.org/pub/software/scm/git/docs/git-commit.html

关于git - 如何创建过去日期的 git 提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13339992/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com