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

标签 git

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

我已经搜索过了,据我所知可以使用 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/

相关文章:

git - 您如何构建 Git 存储库工作流程?

rebase后git分支出现分歧

git - git中 'tracking'的概念有不同的含义吗?

git - GIT : I've got no branch! 吓坏我的生活

git - _netrc 可以处理带空格的密码吗?

git - 在 GitHub 上使用 Git 维护多个应用程序版本

git - GIT、Bitbucket 和 sourcetree 的关系

http和ssh的Gitolite服务器端设置

android - Eclipse:如何将 git 项目导入为必须推送到 Bitbucket 的 Android 项目的库

android - 未找到 SDK 位置