Cherry-Picking a Range
Three real commits, one complete feature. Bring all three over at once — and handle the real conflict along the way.
feature/soup-specials has three genuinely complete, real commits: a new autumn menu file, a real addition to the shared soup-specials.md, and a new winter menu file. All three belong together — cherry-picking them one at a time would work, but git's real A..B range syntax does all three in a single command.\n\nprint/fall-edition has, independently, its own real edit to that same shared soup-specials.md file. The first and third commits in the range apply perfectly cleanly — they touch different files entirely. The middle one does not: a real, genuine conflict, resolved by hand, exactly like every other real conflict this curriculum has covered.
The Real, Complete Feature
git log --oneline feature/soup-specials -3
Three real commits, meant to travel together as one unit.
Cherry-Picking the Whole Range
git cherry-pick <oldest>^..<newest>
The ^ after the oldest hash means "starting from and including this commit" — without it, the range would begin one commit too late.
The Real, Middle Conflict
CONFLICT (content): Merge conflict in soup-specials.md
The first commit (a new file) applied cleanly. The second genuinely conflicts with fall-edition's own real, independent edit to the same shared file.
Resolving and Letting the Range Finish
git add soup-specials.md
git cherry-pick --continue
Once resolved, the range keeps going on its own — the third commit applies cleanly, with no further real intervention needed.
git cherry-pick A..B
Applies every real commit from A (exclusive) through B (inclusive) as a single range operation. Confirmed directly in this lab: using A^..B instead genuinely includes A itself in the range, since ^ steps back to its real parent.
A real conflict during a range cherry-pick
Pauses the whole range exactly like a rebase conflict does — resolve the one real conflicting commit, then --continue lets the rest of the real range proceed automatically. Confirmed directly in this lab: the third commit applied with zero further intervention.
🔍 Discover the Real, Complete Feature
Three real commits on feature/soup-specials, meant to travel together.
cd ~/team-recipes && git log --oneline feature/soup-specials -3student@lab:~$ cd ~/team-recipes && git log --oneline feature/soup-specials -3 7897f74 (feature/soup-specials) Add winter menu file 29cad8b Add tomato basil soup special d34edce Add autumn menu file
📦 Cherry-Pick the Whole Real Range
One command, three commits — the first two land, the second genuinely conflicts.
cd ~/team-recipes && git switch print/fall-editioncd ~/team-recipes && OLDEST=$(git log --format=%H feature/soup-specials -3 | tail -1); NEWEST=$(git log --format=%H feature/soup-specials -3 | head -1); git cherry-pick "${OLDEST}^..${NEWEST}"cd ~/team-recipes && cat soup-specials.mdstudent@lab:~$ cd ~/team-recipes && git switch print/fall-edition Already on 'print/fall-edition' student@lab:~$ cd ~/team-recipes && OLDEST=$(git log --format=%H feature/soup-specials -3 | tail -1); NEWEST=$(git log --format=%H feature/soup-specials -3 | head -1); git cherry-pick "${OLDEST}^..${NEWEST}" [print/fall-edition 302bea1] Add autumn menu file Date: Thu Aug 27 20:30:24 2026 +0200 1 file changed, 3 insertions(+) create mode 100644 autumn-menu.md Auto-merging soup-specials.md CONFLICT (content): Merge conflict in soup-specials.md error: could not apply 29cad8b... Add tomato basil soup special hint: After resolving the conflicts, mark them with hint: "git add/rm <pathspec>", then run hint: "git cherry-pick --continue". hint: You can instead skip this commit with "git cherry-pick --skip". hint: To abort and get back to the state before "git cherry-pick", hint: run "git cherry-pick --abort". student@lab:~$ cd ~/team-recipes && cat soup-specials.md Soup Specials Rotating seasonal soup specials. <<<<<<< HEAD Featuring hearty fall soups for the season. ======= Tomato basil soup. >>>>>>> 29cad8b (Add tomato basil soup special)
✏️ Resolve It, and Let the Range Finish
One real fix, then the rest of the range completes on its own.
cd ~/team-recipes && printf 'Soup Specials\n\nRotating seasonal soup specials.\n\nFeaturing hearty fall soups for the season.\n\nTomato basil soup.\n' > soup-specials.mdcd ~/team-recipes && git add soup-specials.mdcd ~/team-recipes && git cherry-pick --continuecd ~/team-recipes && git log --oneline -3cd ~/team-recipes && ls winter-menu.mdstudent@lab:~$ cd ~/team-recipes && printf 'Soup Specials\n\nRotating seasonal soup specials.\n\nFeaturing hearty fall soups for the season.\n\nTomato basil soup.\n' > soup-specials.md student@lab:~$ cd ~/team-recipes && git add soup-specials.md student@lab:~$ cd ~/team-recipes && git cherry-pick --continue [print/fall-edition 3ecccba] Add tomato basil soup special Date: Thu Aug 27 20:30:24 2026 +0200 1 file changed, 2 insertions(+) [print/fall-edition 32c818f] Add winter menu file Date: Thu Aug 27 20:30:24 2026 +0200 1 file changed, 3 insertions(+) create mode 100644 winter-menu.md student@lab:~$ cd ~/team-recipes && git log --oneline -3 32c818f (HEAD -> print/fall-edition) Add winter menu file 3ecccba Add tomato basil soup special 302bea1 Add autumn menu file student@lab:~$ cd ~/team-recipes && ls winter-menu.md winter-menu.md
Lab 3.2.2 complete. A real, complete three-commit feature, cherry-picked as one range — real conflict included:\n\n\n Real range identified : ✅ 3 commits\n Range cherry-pick begun : ✅ A^..B\n Real conflict resolved : ✅ by hand\n Range completed : ✅ automatically\n
Enable JavaScript to run the live terminal and track your progress.