如何配置'git log'以显示'提交日期' [英] How to configure 'git log' to show 'commit date'

查看:1514
本文介绍了如何配置'git log'以显示'提交日期'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置 git log 来显示 commit date 而不是 author date

How can I configure git log to show commit date instead of author date?

推荐答案

有几个选项。可能最简单的方法就是使用预先准备好的 - 漂亮的格式之一,比如 git log --pretty = fuller - 这会显示两个日期。如果您只想查看一个日期,但将其作为提交日期,则可以使用 git log --format =< some stuff> 。用于定义格式的所有允许代码均记录在 git help log 。提交日期是%cd %cD %cr %ct %ci ,具体取决于您喜欢的格式。

There are several options. Probably the easiest is to just use one of the pre-baked --pretty formats, like git log --pretty=fuller - this will show both dates. If you want to see only one date, but make it the commit date, you can use git log --format=<some stuff>. All the allowable codes for defining the format are documented in git help log. The commit date is one of %cd, %cD, %cr, %ct or %ci, depending on what format you prefer it in.

如果您希望经常执行此操作,请将其放入别名或编写辅助脚本以节省打字时间。

If it's something you want to do often, put it in an alias or write an auxiliary script to save on typing.

这篇关于如何配置'git log'以显示'提交日期'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆