git - git 日期语法规范

标签 git

传递日期的语法有规范吗 混帐?例如,什么日期被接受 “git rev-list”的“--before”选项?

假设没有这样的规范,有没有 让 git 将日期转换为规范日期的方法 形式,以便可以检查给定的日期字符串 被解释为人们所期望的吗? (更新:我已经 写了一个脚本来做这个,这是可用的 here .)

信息说明:日期解析似乎已实现 在文件 date.c 中,在 git 存储库的根目录中。 “入口点”似乎是一个名为 approxidate_careful.

最佳答案

据我所知,它没有在任何地方明确指出,但它似乎接受它可以输出的所有格式,如 --date 选项的文档中所述:

--date=(relative|local|default|iso|rfc|short|raw)

Only takes effect for dates shown in human-readable format, such as when using --pretty. log.date config variable sets a default value for log command’s --date option.

--date=relative shows dates relative to the current time, e.g. "2 hours ago".

--date=local shows timestamps in user’s local timezone.

--date=iso (or --date=iso8601) shows timestamps in ISO 8601 format.

--date=rfc (or --date=rfc2822) shows timestamps in RFC 2822 format, often found in E-mail messages.

--date=short shows only date but not time, in YYYY-MM-DD format.

--date=raw shows the date in the internal raw git format %s %z format.

--date=default shows timestamps in the original timezone (either committer’s or author’s).

关于git - git 日期语法规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14023794/

相关文章:

git - 如何仅为已提交的文件生成 diff 补丁文件?

ruby-on-rails - Capistrano 部署(cap 部署)失败,身份验证错误

python - GitHub 从 raw.githubusercontent 获取存储库中所有文件的列表?

windows - 映射的 Windows 驱动器中的 Git 工作树

git - 无法克隆 repo 。服务器证书验证失败

git - 'TortoiseSVN --> Show log --> Revert to this revision' 的 TortoiseGit 等价物

git - TortoiseGit: "Stash POP Fail!!!"重复,即使在解决冲突之后

GIT:如何正确地将远程分支下载到本地?

Git 克隆不工作 - 错误 443

git status --short : missing "Your branch is ahead of ' origin/master' by 1 commit"