Thursday, 26 January 2017

What is the use of git cherry-pick command?

cherry-pick command will be useful, when you want to pick specific commit from one branch and apply it on another branch.


Let's say two developers working on a feature, each developer working on separate task relate to the feature on two different branches and commit it once the task has been done. At the end of the day, they need to merge both the task together and merge it with master branch. In this case, we pick one of the developer commit by copy it's commit ID got from git log command and navigate it to another developer branch and using the following command git cherry-pick <copied-commit-id>apply the changes in the commit to the current developer branch.

No comments:

Post a Comment