HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git rev-list — List revisions (commits) in reverse chronological order. More information: <https://git-scm.com/docs

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandgit rev-listclicommitschronologicalreverserevisionslist

Problem

How to use the git rev-list command: List revisions (commits) in reverse chronological order. More information: <https://git-scm.com/docs/git-rev-list>.

Solution

git rev-list — List revisions (commits) in reverse chronological order. More information: <https://git-scm.com/docs/git-rev-list>.

List all commits on the current branch:
git rev-list {{HEAD}}


Print the latest commit that changed (add/edit/remove) a specific file on the current branch:
git rev-list {{[-n|--max-count]}} 1 HEAD -- {{path/to/file}}


List commits more recent than a specific date, on a specific branch:
git rev-list --since "{{2019-12-01 00:00:00}}" {{branch_name}}


List all merge commits on a specific commit:
git rev-list --merges {{commit}}


Print the number of commits since a specific tag:
git rev-list {{tag_name}}..HEAD --count

Code Snippets

List all commits on the current branch

git rev-list {{HEAD}}

Print the latest commit that changed (add/edit/remove) a specific file on the current branch

git rev-list {{[-n|--max-count]}} 1 HEAD -- {{path/to/file}}

List commits more recent than a specific date, on a specific branch

git rev-list --since "{{2019-12-01 00:00:00}}" {{branch_name}}

List all merge commits on a specific commit

git rev-list --merges {{commit}}

Print the number of commits since a specific tag

git rev-list {{tag_name}}..HEAD --count

Context

tldr-pages: common/git rev-list

Revisions (0)

No revisions yet.