LinuxCommandLibrary

git-rev-list

List commit objects in reverse chronological order

TLDR

List all commits

$ git rev-list HEAD
copy
Count commits
$ git rev-list --count HEAD
copy
List commits in range
$ git rev-list [commit1]..[commit2]
copy
List with date order
$ git rev-list --date-order HEAD
copy
List reachable from multiple
$ git rev-list [branch1] [branch2] --not [main]
copy
First parent only
$ git rev-list --first-parent HEAD
copy

SYNOPSIS

git rev-list [options] commits... [--] [paths...]

DESCRIPTION

git rev-list lists commit objects in reverse chronological order. It is a low-level plumbing command used for enumerating reachable commits and objects, forming the basis for many higher-level Git commands.
Common uses include counting commits, finding merge bases, and building commit ranges for other tools.

PARAMETERS

--count

Show count only.
--max-count n
Limit output.
--since date
Commits after date.
--until date
Commits before date.
--author pattern
Filter by author.
--first-parent
Follow first parent only.
--ancestry-path
Show ancestry path.
--objects
Include objects.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community