Mastering git, Part 5, git cherry-pick

Git cherry-picking is a feature in Git that allows you to select and apply specific commits from one branch to another, rather than merging the entire branch. This can be useful when you want to apply a specific change or fix to a different branch, without merging the entire branch.

Imagine the following situation, you are working on a feature branch, and you have added an API (in the commit F0) in your current feature branch that might be needed in the master branch or other feature branches, so you can apply that hot-fix without applying other changes. In the following, we want to have the changes regarding the F0 from the feature branch in the master branch, so once we are in the master branch we find the hash for the commit that we need and then:

 

 

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x