Skip to main content
Chapter 15 of 61 · 1 sections · Page 88

Git: Rev-List

Filter and list commits between branches to verify merges and commit ancestry.

Original chapter reference: Chapter 15: Rev-List. The command options and documentation recipes below are fully transcribed from Git Notes for Professionals.

Parameter Details --oneline Display commits as a single line with their title.

Section 15.1: List Commits in master but not in origin/master

Source example · PDF page 88
git rev-list --oneline master ^origin/master

Git rev-list will list commits in one branch that are not in another branch. It is a great tool when you're trying to figure out if code has been merged into a branch or not.

Using the --oneline option will display the title of each commit. The ^ operator excludes commits in the specified branch from the list. You can pass more than two branches if you want. For example, git rev-list foo bar ^baz lists commits in foo and bar, but not baz.

Buy me a coffee
Daily Practice
0/0