git log
The Ultimate Log Format
Over time, I’ve decided that I like the following log format for most of my work.
EXECUTE:
git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
It looks like this:
OUTPUT:
$ git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short * e2a3502 2012-03-06 | Added a comment (HEAD, master) [Jim Weirich] * d46b035 2012-03-06 | Added a default value [Jim Weirich] * fa23feb 2012-03-06 | Using ARGV [Jim Weirich] * 4ac2080 2012-03-06 | First Commit [Jim Weirich]
Let’s look at it in detail:
--pretty="..."defines the format of the output.%his the abbreviated hash of the commit%dare any decorations on that commit (e.g. branch heads or tags)%adis the author date%sis the comment%anis the author name--graphinforms git to display the commit tree in an ASCII graph layout--date=shortkeeps the date format nice and short
reference:http://gitimmersion.com/lab_10.html

浙公网安备 33010602011771号