The cherry-pick command applies a specific commit from one branch to another. Use it to transfer individual changes, such as a bug fix, from a development branch to a main branch without merging unrelated changes.
Procedure
-
In the Codeup console, navigate to your target repository. In the left-side navigation pane, click Commits, then click the target commit to view its details.
-
To apply the changes from this commit to a target branch, click the
icon in the upper-right corner and select Cherry-pick. -
In the dialog box, select the target branch to which you want to apply the commit. We recommend selecting Create a new branch and start a merge request for this change to ensure the process is compliant and traceable through a code review.
-
The merge request creation page opens. The system automatically populates the title, for example, Cherry-pick "change port", and adds the source commit ID to the description. Set the reviewer, label, and associated resources as needed. After confirming the information, click OK to create the merge request.
-
Once the merge request is approved, click Merge in the upper-right corner. Select a merge method or keep the default. Review the merge information and click Commit.
-
If you do not select Create a new branch and start a merge request to review this change, you can push the commit directly to the target branch to apply the commit.