pretty format

The git log and git show option (--format or --pretty) that sets exactly which fields each commit prints, using placeholders such as %h, %an and %s.

In more detail

%h is the abbreviated ID, %an the author name, %ad the author date, %s the subject and %B the raw message. --date=short prints dates as year-month-day. Scripts use a custom format so their output does not change when Git's default layout does.

Examples

git log --format='%h %an %s'
git log --pretty=format:'%h %ad %s' --date=short -3

Related terms

Taught in

References