gpt4 book ai didi

windows - 带有 %cI 占位符的 git log 漂亮格式返回 "cI"而不是提交日期

转载 作者:行者123 更新时间:2023-12-04 19:35:26 25 4
gpt4 key购买 nike

我正在运行一个脚本来获取服务器中某些存储库的提交数据。
我正在使用的 git 命令是这样的:

git log HEAD -1 --pretty=%H~%h~%cI~%cE~%cn~%s
它在我的 Windows 电脑上完美运行,但在我的 CentOS 服务器上,它打印字符串“cI”而不是格式化的 ISO 日期。
Windows PC 上的结果:
40c688e4976d28a560f5711e73c2a933da3cfbbe~40c688e~2021-07-02T17:18:48-04:00~usertest@mail.com~gituser1~Commit into master
CentOS 服务器相同存储库上的结果:
40c688e4976d28a560f5711e73c2a933da3cfbbe~40c688e~cI~usertest@mail.com~gituser1~Commit into master
可能是什么问题呢?
编辑:
我在 windows 上使用 git 版本 2.30.0.windows.2 在 CentOS 上使用 git 版本 1.8.3.1

最佳答案

这很可能是因为您在 centos 上使用的 git 版本不支持 --pretty=%cI。 .考虑更新它。我可能错了,但我认为它出现在版本 v2.2.0 的 git 中. https://github.com/git/git/commit/466fb6742d7fb7d3e6994b2d0d8db83a8786ebcf

关于windows - 带有 %cI 占位符的 git log 漂亮格式返回 "cI"而不是提交日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68365437/

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