Cherry-Picking a Fix to Multiple Branches

A real, genuine food-safety error. It needs to reach two already-published branches, today.

The roast chicken recipe genuinely says 350F for 20 minutes — nowhere near enough to safely cook a whole chicken. It is not just on master; it already shipped to two real, separately published editions: print/spring-edition and print/summer-edition, each with their own real, independent edition notes.\n\nThis is not a case for merging a whole branch — each edition branch has its own real, separate content that should stay exactly as it is. git cherry-pick is the real, surgical tool: take exactly this one real commit's change and apply it, as a genuinely new commit, onto each branch that needs it.

The Real Fix, Once

sed -i 's/roast at 350F for 20 minutes\./roast at 350F for 45 minutes, or until internal temperature reaches 165F./' roast-chicken.md
git commit -am "Fix undercooked roast chicken time - food safety"

Cherry-Picking It to Each Real Branch

git switch print/spring-edition
git cherry-pick <fix-hash>
git switch print/summer-edition
git cherry-pick <fix-hash>

Each real application is a genuinely new commit — same real change, applied independently, with its own real hash and its own real parent on that specific branch.

git cherry-pick <commit>

Applies one real, specific commit's changes onto the current branch as a genuinely new commit. Confirmed directly in this lab: the exact same real fix, applied to two separate branches, produced two genuinely different commit hashes.

🔧 Fix It Once, on Master

A real, genuine food-safety correction — one commit, on master.

cd ~/team-recipes && sed -i 's/roast at 350F for 20 minutes\./roast at 350F for 45 minutes, or until internal temperature reaches 165F./' roast-chicken.md
cd ~/team-recipes && git add roast-chicken.md
cd ~/team-recipes && git commit -m 'Fix undercooked roast chicken time - food safety'

student@lab:~$ cd ~/team-recipes && sed -i 's/roast at 350F for 20 minutes\./roast at 350F for 45 minutes, or until internal temperature reaches 165F./' roast-chicken.md student@lab:~$ cd ~/team-recipes && git add roast-chicken.md student@lab:~$ cd ~/team-recipes && git commit -m 'Fix undercooked roast chicken time - food safety' [master d62c31d] Fix undercooked roast chicken time - food safety 1 file changed, 1 insertion(+), 1 deletion(-)

🍒 Cherry-Pick to the Spring Edition

The exact same real fix, applied as a genuinely new commit.

cd ~/team-recipes && git switch print/spring-edition
cd ~/team-recipes && git cherry-pick $(git log --format=%H master -1)
cd ~/team-recipes && cat roast-chicken.md

student@lab:~$ cd ~/team-recipes && git switch print/spring-edition Switched to branch 'print/spring-edition' student@lab:~$ cd ~/team-recipes && git cherry-pick $(git log --format=%H master -1) [print/spring-edition cb0bd82] Fix undercooked roast chicken time - food safety Date: Thu Aug 27 20:29:50 2026 +0200 1 file changed, 1 insertion(+), 1 deletion(-) student@lab:~$ cd ~/team-recipes && cat roast-chicken.md Roast Chicken Season chicken, roast at 350F for 45 minutes, or until internal temperature reaches 165F.

🍒 Cherry-Pick to the Summer Edition Too

The same real fix, a second genuinely independent application.

cd ~/team-recipes && git switch print/summer-edition
cd ~/team-recipes && git cherry-pick $(git log --format=%H master -1)
cd ~/team-recipes && cat roast-chicken.md

student@lab:~$ cd ~/team-recipes && git switch print/summer-edition Switched to branch 'print/summer-edition' student@lab:~$ cd ~/team-recipes && git cherry-pick $(git log --format=%H master -1) [print/summer-edition c576bd3] Fix undercooked roast chicken time - food safety Date: Thu Aug 27 20:29:50 2026 +0200 1 file changed, 1 insertion(+), 1 deletion(-) student@lab:~$ cd ~/team-recipes && cat roast-chicken.md Roast Chicken Season chicken, roast at 350F for 45 minutes, or until internal temperature reaches 165F.

Lab 3.2.1 complete. A real safety fix, surgically applied to two real, separately published branches:\n\n\n Real fix committed once : ✅ on master\n Cherry-picked to spring : ✅ new real commit\n Cherry-picked to summer : ✅ new real commit\n

Enable JavaScript to run the live terminal and track your progress.