InterviewSolution
| 1. |
What is "git cherry-pick"? |
|
Answer» Cherry picking in Git shifts a commit from one branch and apply it onto another one. This is indifferent to other ways like merge and re-bases which moves many COMMITS onto another branch. Make sure we are on the same branch we would like to apply the commit to.
Note :commit-hash: Unique identifier for commit. If we cherry-pick from a public repo branch, we should consider below command :
This will ALWAYS generate a standardized commit message. This way, our team members can still keep track of the origin of the commit and may avoid merge conflicts in the future. If we have notes attached to the commit that does not follow the cherry-pick. To bring them over as well, we can use:
A common use case for cherry-picking is to forward- or back-port commits from a maintenance branch to a DEVELOPMENT branch. |
|