Cherry-pick Process
Some maintainers prefer to derive or pick up the contributor's code, rather than simply merging, because it can maintain a linear commit history. If you have completed the development of a feature and decided to introduce it into the main code, you can go
The feature branch then executes the derivative command. Fortunately, You Can resubmit these modifications on your main branch (or possibly the develop branch. If the code works well, you can quickly go to the master branch to obtain a linear commit history.
Another way to introduce code is to pick it up. Pick-up is similar to the combination of a specific submission. It first extracts the patch submitted, and then tries to apply it to the current branch. If a feature branch has multiple commits, but you only want to introduce one of them, you can use this method. It may also be because you like to pick up and hate the combination. Suppose you have a project similar to figure 5.26.
If you want to pull e43a6 to your trunk branch
$ Git cherry-pick e43a6fd3e94888d76779ad79fb568ed180e5fcdffinished one cherry-pick. [Master]: created a0a41a9: "More friendly message when locking the index fails. "3 files changed, 17 insertions (+), 3 deletions (-)
This will introduce the code of e43a6, but will get different SHA-1 values, because the application date is different. Your history now
It looks like figure 5.27.
Now, you can delete this feature branch and discard the commit that you don't want to introduce.