git log

The Git command that lists commits with their identifiers, authors, times and messages.

In more detail

Plain git log shows each commit's ID, author, date and message. Flags shape it: --oneline for one line per commit, -n or a number such as -2 to limit how many, --graph to draw branches, --stat or --patch to show what changed, and -- path to show only commits touching a file. Filters such as --since, --author and --grep narrow the list further.

Examples

git log --pretty=format:'%h %ct' > commits.txt
git -C fixture log --format='%ad %s' --date=short -3
git -C fixture log --grep=Remediates --format='%s'
git log --oneline -- parser.py

Related terms

Taught in

References