【问题标题】:How to change the git log committed log date format如何更改 git log 提交的日志日期格式
【发布时间】:2019-12-28 09:23:25
【问题描述】:

是否有任何可能的方法可以在 git log 命令本身中将 git log 数据格式从“2019-08-22 06:38:34 +0000”更改为“20190822063834”,或者是否有任何替代选项很棒

git log  --pretty=format:"%ci" --decorate=full

2019-08-22 06:38:34 +0000
2019-08-22 06:38:34 +0000  
2019-08-22 06:38:33 +0000
2019-08-22 06:38:33 +0000
2019-08-22 06:38:32 +0000
2019-08-22 06:38:26 +0000

git log  --pretty=format:"%ci" --decorate=full

20190822063834
20190822063834
20190822063833
20190822063833
20190822063832
20190822063826

【问题讨论】:

    标签: git github bitbucket git-bash


    【解决方案1】:

    您可以尝试使用自定义日期格式,如shown here:

    git log --date=format:'%Y%m%d%H%M%S' --pretty=format:"%cd" --decorate=full
    

    请注意,我 use %cd 尊重 --date= 选项,而不是 %ci(类似 ISO 8601 的格式)。

    【讨论】:

      猜你喜欢
      • 2011-12-12
      • 1970-01-01
      • 1970-01-01
      • 2012-12-23
      • 2022-01-16
      • 2020-07-06
      • 2019-08-04
      • 2018-09-06
      • 2015-01-13
      相关资源
      最近更新 更多