Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 558 Bytes

git-rev-list.md

File metadata and controls

31 lines (22 loc) · 558 Bytes

git rev-list

Show commits in the commit tree of a given ref

# newest first
git rev-list master

# show current/latest commit
git rev-list --max-count=1 master
git rev-list master | head -n1

# Reverse the order (oldest to newest)
git rev-list --reverse master

# Count the number of commits
git rev-list --count master

# Show commits touching a given file.
git rev-list master -- path/to/file

ahead/behind

# Shows:
#   1. N commits in A, *not* in B
#   2. N commits in B, *not* in A
git rev-list --left-right --count A...B