LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-cherry

Find commits not merged upstream

TLDR

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

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
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

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

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid