Cherry Pick
CherryPick is used to select specific commits from one branch and apply them to another branch, without merging the entire branch's changes. This allows you to selectively introduce code changes with great precision, without merging the entire branch.
Its name comes from "cherry-picking," as you only select the "fruits" (commits) you need.
Use Cases
- Extracting specific features or fixes from a development branch:
For example, you have completed an important fix in the dev branch but need to apply it to the main branch.
- Borrowing code from another person's branch:
When there is a commit in another developer's branch that is useful to you, you can directly extract that commit into your branch.
- Sharing a single commit between branches:
Reuse certain features or fixes across different branches without merging all changes.