Copying commits to other branches
You can copy an existing commit from another branch to the current branch within the repository using the git cherry-pick command.
Cherry-picking allows you to:
- Move a commit from the wrong branch to the right branch.
- Add a commit to the current branch based on an existing commit from another branch.
![Use git cherry-pick to change the branch of a commit. Diagram using the cherry-pick command.](/static/a949dbd7b0f4d70ae43f51e5d602d8c1/5a190/01.png)