Cherry-picking multiple commits
📖 Scenario: You are working on a project with multiple branches. You want to bring specific changes from one branch into another without merging the entire branch. This is useful when you only need some fixes or features from a different branch.
🎯 Goal: Learn how to cherry-pick multiple commits from one branch to another using Git commands.
📋 What You'll Learn
Create a new branch called
feature from mainMake three commits on the
feature branch with exact commit messagesSwitch back to
main branchCherry-pick two specific commits from
feature branch onto mainDisplay the commit log on
main to verify cherry-pick💡 Why This Matters
🌍 Real World
Cherry-picking is used when you want to apply specific changes from one branch to another without merging all changes. For example, applying a bug fix from a development branch to the main branch quickly.
💼 Career
Understanding cherry-pick helps in managing code changes efficiently in team projects, especially when working with multiple branches and needing selective updates.
Progress0 / 4 steps