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

旧街凉风 提交于 2019-12-11 16:09:00

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!