问题
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?
回答1:
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
回答2:
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
来源:https://stackoverflow.com/questions/53809600/how-to-commit-date-in-git-log-all-graph-oneline-simplify-by-decoration