• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Draft / Git Cherry-pick

Git Cherry-pick

Last updated on September 17, 2018 by Sal Ferrarello

When doing git cherry-pick, remove the commit from the source branch then rebase the source branch with the destination branch. This introduces the cherry-picked changes before any of your branch specific code.

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit
Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

Reader Interactions

Comments

  1. Jeremy Pry says

    September 17, 2018 at 2:08 pm

    I’m curious, what issues have you seen with cherry picking? While I don’t use it everyday, I’ve used it plenty of times without issue. I would love to know about the potential drawbacks from real experience.

    Reply
    • Sal Ferrarello says

      September 18, 2018 at 8:49 am

      I’ve seen people get jammed up by cherry-picking a commit from a branch and then later trying to merge that branch and getting a merge conflict. The problem they encounter is the changes exist in two different commits (the original commit) and the commit created by the cherry-pick.

      I like to delete the original commit and use the commit created by the cherry-pick only.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in