LinuxCommandLibrary

git-log

Display commit history

TLDR

Show commit history

$ git log
copy
Show compact log
$ git log --oneline
copy
Show graph view
$ git log --graph --oneline --all
copy
Show specific file history
$ git log [file.txt]
copy
Show last N commits
$ git log -n [5]
copy

SYNOPSIS

git log [options] [revision] [--] [path]

DESCRIPTION

git log shows the commit history in reverse chronological order. Each entry displays the commit hash, author, date, and message. Extensive formatting and filtering options enable customized output for any use case.
The command supports filtering by author, date range, file path, and message content. Graph mode visualizes branch structure with ASCII art. Custom format strings enable scripted log processing and report generation.

PARAMETERS

--oneline

Compact one-line format.
--graph
Show branch graph.
--all
Show all branches.
-n NUM
Limit to N commits.
--author AUTHOR
Filter by author.
--since DATE
Show commits since date.
--stat
Show changed files.
-p, --patch
Show diffs.
--format FORMAT
Custom format string.
--help
Display help information.

CAVEATS

Large histories can be slow. Some options don't combine. Graph may need wide terminal.

HISTORY

git log is a core Git command from initial release, providing the essential capability to view commit history.

SEE ALSO

git-show(1), git-blame(1), tig(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community