LinuxCommandLibrary

git-log

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. It displays commits in reverse chronological order with details including author, date, and message. Extensive formatting options enable customized output.
The command supports filtering by author, date, path, and message. Graph mode visualizes branch structure. Custom formats enable scripted log processing.
git log is the primary tool for exploring repository history.

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)

Copied to clipboard