Bald Bearded Builder
git/what-is-git-cherry-pick

What is Git Cherry-Pick?

Git cherry-pick applies a specific commit from another branch while preserving the rest of that branch's work.

Loads from YouTube when you press play

Transcript 1 topic

Cherry-pick commits

0:00

What is the git cherry pick command? Let's imagine that we're working on a project together. I'm gonna go work on feature a while you're working on feature b. And then at some point along the way, you notice some of the code I've written and you're like, hey, I need part of that. But not all of it.

That's where git cherry pick comes in. Using git cherry dash pick and then a commit will let me merge that change or changes into my working tree. So is there anything special you need to know? Maybe. First, Cherrypig works similarly to merge, so there may be some conflicts that you have to clean up.

Secondly, Git has a built in commit message that it'll use, but you can specify the dash e parameter and specify a commit message that you like better. And now you know the basics of git cherry pick. If this was helpful or there's a git command you'd like to see me cover, let me know in the comments. Until next time.

Sign in to join in. Reading needs nothing.