Gitflow
🍇Cherry-Pick a Range of CommitsMedium+550 XP
Workshop
Scenario reference

Cherry-Pick a Range of Commits: the situation, step by step

The situation

Hotfix branch has 4 sequential commits. You need all of them on `release-1.x`. One at a time is tedious.

Use `A..B` (exclusive) or `A^..B` (inclusive) range syntax with cherry-pick.

Medium · 2 steps · +550 XP

What you will practice

This scenario walks through 2 steps, in order:

  1. 01Cherry-pick the whole range
  2. 02Verify history
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. Cherry-pick the whole range
    git cherry-pick ch00002^..ch00005
  2. 2. Verify history
    git log --oneline

Key takeaway

`git cherry-pick A^..B` picks A through B inclusive.