Here we have a feature branch with two commits, f1, and f2.
Now, let's see one of these commits, like f1 has some
interesting changes we want to have in master. But we're not
quite ready to merge our feature branch into master. What should
we do now, this is where we use cherry picking. So we can cherry
pick this particular commit, and apply it on top of master. Let
me show you how to do this. Here in our history, you can see that
our feature branch, it's one commit ahead of master. Now
we're going to bring this particular commit into master
without merging. So I'm going to copy this commit ID. Now we're
currently on Master, we type Git cherry, dash pig, either type
the commit ID, here we have a conflict in table of contents of
txt. So let's open up our merge tool. In this demo, I'm going to
take the changes in the remote branch, which is our feature
branch. So I'm going to select this purple icon. Good, save the
changes, close the merge tool. We're back here. As we can see,
in the terminal window, we're in the middle of a cherry pick.
Let's have a quick look at our staging area. So our table of
contents file has some changes that are in the staging area. We
also have this directory here, DS on the land store, don't
worry about it. This is only for Mac computers. This is one of
those standard directories that we need to include in our Git
ignore file. For now, let's not worry about it. So let's make a
commit. I'm gonna specify a message. The default message
that we have here is based on the commit that you were trying
to cherry pick, so we can accept it or change it if necessary.
Now close back in the terminal. Let's look at our history one
more time. So master has moved forward. And now we have this
new commit that we cherry picked from our feature branch.