Cherry-Pick Commits
Use Cherry-Pick Commits to copy several commits to the branch you have checked out, for example to bring fixes from main to a release branch. Zide shows the commits and their order first. Git then applies them one at a time, and each new commit keeps the author and message of the original. Nothing is pushed.
To copy one commit, use Cherry-Pick This Commit… instead. See Commit actions.
Select the commits
- Check out the branch that must receive the commits.
- Open Commits. To see commits on other branches, click Show filters, then under Branch select All branches.
- Hold Ctrl (Cmd on macOS) and click each commit, or click its checkbox. The commits do not have to be next to each other. To select every commit between two rows, click the first one and hold Shift while you click the last one.
- Right-click one of the selected commits and click Cherry-Pick Selected Commits….
Selected rows have a tint. A Ctrl-click or a checkbox click adds or removes only that commit. A click without a key opens the commit and clears the selection. Clear Selection in the same menu also clears it.
Row checkboxes are off in the Commits panel by default. To show them, click More actions in the panel header and click Show Selection Checkboxes.
To select from the keyboard, press Tab until a commit shows a focus ring. Move with Up and Down, and press Space to add or remove the focused commit. Shift+Up and Shift+Down select a range. Then press the Menu key or Shift+F10 and press Enter on Cherry-Pick Selected Commits…. For all selection keys, see Select more than one item.
Review the plan
Zide opens the Cherry-Pick Commits tab. A line below the title names the branch that receives the commits and the commit it points to now, for example Onto release, now at a505f1b.
Under Order to apply, the list shows the commits in the order Git applies them. Zide puts each commit after the selected commits it builds on, then orders the rest from oldest to newest. The order in which you clicked the commits does not matter.
To change the order, drag a commit by its handle. You can also open the commit’s More actions menu and click Move Up or Move Down. To leave a commit out, click Remove from Plan in the same menu. Open and Open in New Tab show the original commit. Click Reset Plan to put back every selected commit in the proposed order. Click Cancel Cherry-Pick to close the plan without changes. Both ask first when you changed the plan.
Read the notes above the list and under the commits:
- If a commit’s changes are already on the branch, or a conflict resolution removes them, the cherry-pick stops at that commit. You then keep it as an empty commit or skip it. See A commit has no changes to apply.
- A commit that was made with no changes is kept as an empty commit, and the cherry-pick does not stop for it.
- Already on branch marks a commit that the branch already has. It usually stops as an empty commit.
- A merge commit shows a red note. It cannot be part of the plan. Start Cherry-Pick stays unavailable until you remove it. To cherry-pick a merge commit alone, use Cherry-Pick This Commit…, which lets you choose its parent.
A plan needs at least two commits and can have up to 100.
If the branch moves, or you check out another branch, while the plan is open, a notice says so and Start Cherry-Pick is unavailable. Click Review Again. The plan keeps your order and uses the branch that is checked out now.
Closing the tab discards a plan that has not started.
Start the cherry-pick
Click Start Cherry-Pick. If the button is unavailable, its tooltip gives the reason.
The branch must have no uncommitted changes to tracked files, and no untracked or ignored file can be where a commit adds a file. Otherwise Zide shows Cannot Cherry-Pick with the blockers and offers Open Staging or Stash Changes and Review. See A merge, revert, or cherry-pick did not start.
If the working files or staged changes change after the plan loads, the cherry-pick does not start. The tab says so. Look at the changes, then click Start Cherry-Pick again.
Git applies the commits in order. When all of them apply, the tab says, for example, Cherry-pick complete. 3 commits added to release. Each commit shows Applied and the new commit, and Show in Commits shows the result.
Cherry-picking several commits needs Git 2.23 or later.
When the cherry-pick stops
Git stops when it cannot apply a commit on its own. The tab then says where, for example Cherry-pick paused at commit 2 of 3. Each commit shows its number and one of these states:
| State | Meaning |
|---|---|
| Applied | Git made a new commit for it. The line below links to that commit. |
| Kept empty | You kept it as an empty commit. |
| Skipped | Git left it out. Its subject is crossed out. |
| Paused | Git stopped on it. The line below says what to do. |
| Not started | Git has not reached it. |
| Done | Git has passed it, but Zide cannot tell whether it was applied or skipped, because another commit in the plan has the same author and time. |
The Project Header shows the cherry-pick in place of the Branch control, for example Cherry-pick: release. Its menu shows Incoming, commit 2 of 3 with the commit Git stopped on. See Conflict banner. The tab and the Project Header use the same actions.
Closing the tab does not stop the cherry-pick. To reopen it, click the operation label in the Project Header, then Show Cherry-Pick Plan. The cherry-pick and its progress are kept when you restart Zide.
While the cherry-pick is in progress, Staging cannot make an ordinary commit. Use Continue instead, so that each commit keeps its own author and message.
A commit conflicts
The header shows Resolve N files. Click it to open Staging, resolve each file, and stage the result. Then click Continue. Git commits the resolved commit and applies the next ones.
To leave out the commit and its changes, click Skip Commit, then Skip.
A commit has no changes to apply
The commit’s changes are already on the branch, or your conflict resolution removed them. The tab shows three choices:
- Keep Empty Commit makes a commit with no changes, with the original message and author, then continues.
- Skip Commit leaves the commit out and continues.
- Abort Cherry-pick… in the tab’s More actions menu stops the whole cherry-pick.
Continue is unavailable here, and its tooltip says why.
Git stopped before it applied a commit
The row says Git stopped before it applied this commit. and quotes Git’s message, for example about an untracked file that is in the way. Fix the cause, then click Continue. Git tries the same commit again. It does not leave it out.
A hook or commit signing refused a commit
Zide shows the error with View error. Fix the cause, then click Continue to try the commit again.
The commit was made in a terminal
If you commit the stopped commit with git commit, the row says so. Click Continue to go on with the next commit.
Abort the cherry-pick
In the tab, open More actions and click Abort Cherry-pick…. You can also click Abort cherry-pick… in the Project Header menu. The confirmation names the commit that the branch goes back to and how many commits are removed. Git then returns the branch to where it was before the cherry-pick. The tab says The cherry-pick was aborted.
In these cases Zide refuses an action and says why:
- HEAD moved after Git stopped, for example because another tool reset the branch. Zide does not continue, skip, or abort. Use the Reflog to review the change.
- A change that is not part of the cherry-pick was staged after Git stopped. Skip Commit and abort would discard it, so Zide refuses them. Unstage it first. Continue would include it in the commit.
- The stopped commit was committed in a terminal. There is nothing to skip, and Git’s abort would not restore the branch, so Zide refuses both. Click Continue to go on.
- Another branch is checked out. Continue and Skip Commit ask you to confirm. Abort is not available until you check out the original branch again, for example with Check out branch in the Project Header menu.
A cherry-pick started in a terminal
The Project Header also shows a cherry-pick of several commits that you started with git cherry-pick in a terminal. Continue, Skip this commit…, Keep Empty Commit, and Abort cherry-pick… are available, and the checks for a moved HEAD and for staged changes apply. Show Cherry-Pick Plan is available only for a cherry-pick started in Zide.
Zide does not know which branch a cherry-pick from a terminal started on. If you check out another branch while it is paused, Zide does not ask you to confirm, and Continue adds the commits to the branch checked out now. Make sure the correct branch is checked out before you continue, skip, or abort.