Skip to main content
  1. Learn
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git basics
  6. Managing Git history
  7. Cherry-picking commits
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Cherry-picking commits

Cherry-picking in Git allows you to apply a specific commit from one branch to another without merging the entire branch. This is useful for selectively integrating changes.

When to use cherry-picking:

  • Applying specific changes: When you need to apply a particular bug fix or feature from one branch to another without bringing in all the other changes from that branch.
  • Backporting fixes: When you need to apply a fix from a newer branch to an older release branch, ensuring that the fix is included in older versions without merging all the changes from the newer branch.
  • Isolating critical updates: When critical updates need to be applied across multiple branches without merging unrelated changes.
Diagram using the cherry-pick command.

Use git cherry-pick to change the branch of a commit.

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life