Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsTo cherry-pick several commits, check out the branch that should receive them, confirm the working tree is clean, and pass the commit IDs in the order you want them replayed: git cherry-pick <commit-1> <commit-2>. Git applies each change and normally creates one new commit per change on the current branch. The source branch’s full history is not merged. If Git stops on a conflict, resolve the affected files, stage them with git add, and run git cherry-pick --continue.
Before you start
Cherry-pick always works on the branch you have checked out. The branch you copy from is only a place to find commits, so confirm both branches before running anything.
As an Amazon Associate I earn from qualifying purchases.
- Destination: run
git branch --show-current(orgit status) and confirm you are on the branch that should receive the new commits. - Clean tree: run
git status --short. The ordinary cherry-pick operation expects no modifications relative toHEAD. If you have uncommitted work, commit it or set it aside first. - Commit IDs: identify the exact commits on the source branch with
git log. Note their full or abbreviated hashes and the order of their changes.
Apply multiple commits
Pass each commit ID as an argument. For example, to move two changes from a feature branch onto a maintenance branch:
git switch maintenance
git status --short
git cherry-pick <commit-1> <commit-2>
Replace the placeholders with real hashes from your repository. The command does not require a repository or history shape beyond those commits existing.
#1 Best Overall
Order matters
Git replays the commits in the order you list them. If the second change depends on the first (for example, it edits a function the first change added), list the first commit first. Listing commits in the wrong order can produce conflicts that would not occur in the original sequence, or changes that compile but behave incorrectly. Use git log --reverse on the source range to see the oldest commit first when building the list.
Pick commits from another branch
Naming a branch on the command line does not mean “merge this branch.” Cherry-pick selects the commits that are reachable from the refs you name and applies their changes to the current branch. The official cherry-pick manual shows revision-set forms such as git cherry-pick ..master and git cherry-pick ^HEAD master. In both examples, the commits selected are those on master that are not on the current HEAD.
git cherry-pick ..master
git cherry-pick ^HEAD master
Inspect the set before applying it
Revision syntax depends on your repository graph, so a broad range can select more than you expect. List the candidates first:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
git log --oneline HEAD..master
Confirm that every listed commit should be replayed, and reverse the order if needed, before you run the cherry-pick command with the same range.
Handle conflicts
A conflict means Git needs a human decision about the combined result of the two versions. It does not mean the repository has lost its earlier commits.
The state Git leaves behind
According to the cherry-pick manual, the current branch and HEAD stay at the last commit that was successfully created. Git records the problematic commit in CHERRY_PICK_HEAD; the exception is when you use --no-commit. Paths that applied cleanly are updated, and conflicted paths appear in the index and working tree with conflict markers. Run git status to see which files need attention.
Resolve and continue
- Open each conflicted file and edit the conflict markers to produce the intended combined code. Inspect the change from the source commit and the surrounding code on your destination branch before choosing a version. Avoid selecting “ours” or “theirs” for an entire file without reviewing the change.
- Stage each resolved file:
git add <resolved-file>. - Run
git cherry-pick --continue. Git creates the commit for the current change and moves on to the next one in the sequence. - Repeat until
git statusshows no cherry-pick in progress, then run your tests on the result.
The Git merge manual also offers general conflict-inspection tools: comparing diffs, examining the changes from each side, and launching git mergetool. These help with cherry-pick conflicts too. However, after staging, continue the cherry-pick with git cherry-pick --continue. The merge-specific git merge --continue does not apply to a cherry-pick sequence.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Continue, skip, abort, or quit
These four options answer different situations and have different effects. Choose the one that matches what you want to happen to the current commit and the rest of the sequence.
| Command | When to use it | Effect |
|---|---|---|
git cherry-pick --continue |
You have resolved the conflict and staged the files. | Creates the commit for the current change and proceeds with the rest of the sequence. |
git cherry-pick --skip |
The current commit should not be applied to this branch. | Drops that commit from the sequence and moves to the next one. |
git cherry-pick --abort |
You want to cancel the whole sequence and return to where you started. | Returns the branch to its state before the sequence began. |
git cherry-pick --quit |
You want to stop tracking the sequence but keep the current index and working tree. | Clears the sequencer state only. Commits already created stay, and the index and working tree are left as they are; this is not a rollback. |
Because --quit does not undo anything, use --abort when you want to return to the starting point. Use --quit only when the current files are the result you want and you no longer need Git to continue the sequence.
Cherry-pick a merge commit
A merge commit has more than one parent, so Git needs to know which parent to treat as the baseline for the change. Use -m with the parent number:
git cherry-pick -m 1 <merge-commit>
Parent numbers begin at 1. The number is only syntax. It does not tell you which parent is correct for your situation.
Recommended Free Tools
Choose the mainline parent
Inspect the merge before choosing. The parent to select is the one that represents the baseline against which you want the change replayed. Use git show --summary <merge-commit> or git log --graph to see the parents and their histories, then decide which one matches your destination branch. Do not apply -m 1 by habit if the commit came from a different line of development.
Best Value
Cherry-pick or merge
Cherry-pick and merge answer different questions. Merge integrates a branch’s history as a whole. Cherry-pick selects changes at the commit level and creates new commits on the current branch.
| Decision axis | Cherry-pick | Merge |
|---|---|---|
| Unit of integration | Selected commit changes | Changes from a branch since the histories diverged |
| Resulting history | Normally new commits on the current branch | Records the relationship between histories, often with a merge commit depending on the graph and options |
| Typical fit | A targeted fix, a backport, or a small chosen set of commits | Bringing a branch’s work into another branch as a whole |
| Main caution | Replaying changes separately can complicate later history review, and equivalent changes may already be present | Requires managing the full branch integration and may involve conflict resolution |
The Git workflows documentation states: “Most importantly, merging works at the branch level, while cherry-picking works at the commit level.” The same page notes that the project tries to solve as many problems as possible with merges alone, while cherry-picking remains useful in selected cases. See the gitworkflows documentation for the full context.
Check for changes already applied
Once you have replayed commits to a branch, the same change can exist on both sides of a diverged history. The git-log manual documents patch-equivalence filtering across branches. A common form that compares two branches and omits commits with equivalent patches on the other side is:
git log --oneline --left-right --cherry-pick main...maintenance
Patch equivalence is a useful signal, not a substitute for review. Two commits can have matching patches but different surrounding code, so check the actual result on the destination branch.
Version notes
- The behavior described here follows the git-cherry-pick manual for Git 2.56.0.
- Run
git --versionand compare your release with the manual for that version before relying on less common options such as--quitor-m. - Commands and output details can change between releases, so consult the manual for your installed version when results differ from what is described here.
The git-merge manual covers the merge-side conflict tools referenced above.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




