git log --format='%h %an %s'

Category: Git - Core

git log --format='%h %an %s'

Print the log with a custom format

Replaces the default log layout with placeholders: %h for short hash, %an for author name, and %s for subject, among many others like %ad for date. It is the building block for custom log aliases and scripts. Quote the format string so the shell does not expand it.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.