【问题标题】:How to filter the git log with only the commit date yyyyddmm format and commit message which has the release of last three months?如何过滤只有提交日期 yyyyddmm 格式和最近三个月发布的提交消息的 git 日志?
【发布时间】:2022-11-24 04:43:29
【问题描述】:

我想要 git log 的输出如下 -

《2022-06-02发布点》

发布点是我们放入提交消息中的内容。

到目前为止,我已经尝试了以下命令,我在显示的日期格式上遇到了问题并且只获得了提交消息。

git log --pretty=format:"%ad - %an: %s" --after="2022-09-08" --until="2022-11-18" --grep="构建集成点"

它给了我以下输出 -

2022 年 11 月 11 日星期五 16:38:05 +0100 - 作者姓名:-------------------- 发布提交消息 ------------ ----------

我只想要日期和发布提交消息。我希望从我的输出中排除所有其他细节。

【问题讨论】:

    标签: git git-bash git-log


    【解决方案1】:

    我在显示日期时遇到问题

    %ad
    author date (format respects --date= option)
    

    即如果你想要另一种格式:用额外的选项--date来描述它作为日志

    仅获取提交消息

    不要在格式字符串中使用不需要的占位符,即%an

    %an
    author name
    

    【讨论】:

      猜你喜欢
      • 2019-12-28
      • 1970-01-01
      • 2022-01-16
      • 2012-11-18
      • 2015-01-13
      • 1970-01-01
      • 2011-04-18
      • 1970-01-01
      • 2014-06-29
      相关资源
      最近更新 更多