303 — Cherry-Pick

Learn to copy specific commits from one branch to another using cherry-pick. Perfect for applying bug fixes or features to multiple branches without merging everything.

Learning Objectives

1
Understand what cherry-pick does
2
Copy specific commits between branches
3
Handle cherry-pick conflicts
4
Cherry-pick multiple commits
5
Know when to use cherry-pick vs merge
Step 1

Create workspace with multiple branches

Set up a repository that simulates a scenario where cherry-pick is useful.

Commands to Run

mkdir -p ~/git-practice/lesson-303
cd ~/git-practice/lesson-303
git init
echo "# Bug Tracker Application" > README.md
git add README.md
git commit -m "Initial commit"

What This Does

Cherry-pick is useful when you want to apply specific commits to different branches without merging entire branches. We'll simulate a real-world scenario.

Expected Outcome

Repository initialized with initial commit.

Pro Tips

  • 1
    Cherry-pick copies commits, not branches
  • 2
    Think of it as 'copy this specific change to my current branch'

All Steps (0 / 15 completed)