git-cherry

Find commits not merged upstream

TLDR

Show unpicked commits
$ git cherry [upstream] [branch]
Show with commit messages
$ git cherry -v [upstream]
Compare branches
$ git cherry [main] [feature]

SYNOPSIS

git cherry [options] [upstream] [head]

DESCRIPTION

git cherry finds commits not yet applied to upstream. It compares commits between branches, identifying which commits from your branch are missing from upstream based on patch content, not commit hashes.Output uses + for commits not in upstream and - for equivalent commits already present. This helps identify what still needs to be merged or cherry-picked.This command is particularly useful for reviewing branch status before merging, ensuring that all intended changes have been integrated and identifying any commits that may have been lost during rebasing.

PARAMETERS

UPSTREAM

Branch to compare against.
HEAD
Branch to check (default: current).
LIMIT
Only report commits reachable from LIMIT, further limiting output.
-v
Show commit subjects.
--abbrev N
Abbreviate commit hashes.
--help
Display help information.

INSTALL

sudo apt install git
sudo dnf install git
sudo pacman -S git
sudo apk add git
sudo zypper install git
brew install git
nix profile install nixpkgs#git

CAVEATS

Compares patch content, not commit IDs. Rebased commits show as missing. Works best for linear histories.

HISTORY

git cherry is a core Git command for comparing branches by patch equivalence, named after the cherry-pick operation it helps plan.

SEE ALSO

git-cherry-pick(1), git-log(1), git-rebase(1)

RESOURCES

Source code · Homepage · Documentation