Module lessons (4/4)
Targeted commit porting with cherry-pick & --onto
Backport single bugfix commits selectively across release branches cleanly.
What you'll learn in this lesson
- Backport a single critical bugfix cleanly onto a separate release branch using
git cherry-pick <sha>. - Compare surgical
cherry-pickagainst full-branchgit merge,git rebase, and three-arggit rebase --onto. - Tag a hotfix release cleanly while avoiding unreleased commits from
main.
Overview
Imagine main has already raced ahead with experimental v3 work (compute gross total), while production running on an older release/v2 track urgently needs one single VAT rate bugfix commit (main~1, updating tax to 22%)—without dragging unfinished v3 changes along!
git cherry-pick <sha> reads the exact diff patch introduced by commit <sha> and applies it directly as a brand-new commit on your current HEAD:
Sections covered in this lesson
- 1Surgical Backporting Across Release Lines
- 2Visualize Branch Slices Live
Unlock "Targeted commit porting with cherry-pick & --onto" and the full Git & Modern Collaboration curriculum
Backport single bugfix commits selectively across release branches cleanly.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Git & Modern Collaboration plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.