mikezang
mikezang

Reputation: 2499

How to commit date in "git log --all --graph --oneline --simplify-by-decoration"

I use git log --all --graph --oneline --simplify-by-decoration to show large git commit history, but there is no commit date, what can add date?

Upvotes: 1

Views: 3141

Answers (2)

tmaj
tmaj

Reputation: 35115

You can try --pretty='%h %an %aD %s'

See Pretty Formats


Update for 'I want to keep the original color and date in YYYY-MM-DD format...'

git log your_other_options --pretty='%Cgreen%h%Creset %Cblue% cd%Creset %smont' --date=short

Upvotes: 1

rs007
rs007

Reputation: 445

Following seems to be the closest to what you need based on your color needs, it adds commit date per your format, check it out to see if it helps:

git log --all --graph --oneline --simplify-by-decoration --date=short --pretty=format:"%C(yellow)%h%Creset%C(red)%C(bold)%d%Creset%C(white)(%cd)%Creset %s"

For further reading and to choose from a myriad number of options check the Pretty Format docs as listed by @tymtam on the other answer above :Pretty Format docs

Upvotes: 6

Related Questions