How to configure 'git log' to show 'commit date'

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

Answers


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.


You can use --pretty=format and use %cr for commit date relative.

I have the following alias in my .gitconfig

[alias]
lol = log --graph --pretty=format:"%C(yellow)%h%Creset%C(cyan)%C(bold)%d%Creset %C(cyan)(%cr)%Creset %C(green)%ce%Creset %s"

Then simply run git lol and you'll see a nice color history with hash/date/author/comments.


Need Your Help

Django: Make JS source maps compatible with staticfiles filename hashing

django hash gulp source-maps

In our Django project we are using Gulp to compile our assets, then UglifyJS to minify them. During this whole process we are generating sourcemaps, which appear to be working correctly.

Jquery click event is not working properly

javascript jquery

I want a new text input box will be appended when i click onto the latest generated text box.