How to fix error: Cherry-pick is not possible because you have unmerged files in Git

GitINTERMEDIATELOWUpdated Dec 6, 2025ยท 307 views

This error occurs when you attempt a cherry-pick while conflicts from a previous merge or cherry-pick remain unresolved. You must resolve or abort the pending operation before starting a new one.

Quick fix

Fixes error: Cherry-pick is not possible because you have unmerged files

git status
  1. Check the current repository state
  2. Identify the conflicting files
  3. Resolve the conflicts manually
  4. Stage the resolved files
git โ€” error
git status
error: Cherry-pick is not possible because you have unmerged files

What this error means

This error indicates that Git is blocking a new cherry-pick operation because your repository is in the middle of resolving a previous conflict. When a merge, cherry-pick, or rebase encounters conflicts, Git pauses and waits for you to manually resolve those conflicts before continuing. The "unmerged files" mentioned in the error are files that contain conflict markers (<<<<<<, =======, >>>>>>) from a prior operation that hasn't been completed. Git tracks this state using special references like CHERRY_PICK_HEAD or MERGE_HEAD, which indicate an operation is in progress. Until you either resolve these conflicts and commit them, or abort the pending operation entirely, Git will refuse to start any new operation that could introduce additional conflicts. This prevents the confusing situation of having multiple overlapping conflict states.

Typical symptoms

  • Running git cherry-pick fails with 'unmerged files' error
  • git status shows files under 'Unmerged paths'
  • CHERRY_PICK_HEAD or MERGE_HEAD reference exists in .git directory
  • Previous git merge or cherry-pick was interrupted or left incomplete
  • Files in working directory contain conflict markers (<<<<<<, ======, >>>>>>)

Common causes

  1. A previous cherry-pick encountered conflicts and was not resolved or aborted
  2. A merge operation was started but conflicts were never committed
  3. Conflicts were partially resolved but not all files were staged with git add
  4. A rebase was interrupted and left the repository in a conflicted state
  5. Someone ran git cherry-pick --no-commit and forgot to complete or abort it
  6. IDE or GUI tool started a merge/cherry-pick but crashed before completion

How to fix "error: Cherry-pick is not possible because you have unmerged files"

1Check the current repository state

First, identify what operation is in progress and which files have conflicts:

bash
git status

Look for sections like "Unmerged paths" which lists files with conflicts, and messages indicating "You have unmerged paths" or "Cherry-pick currently in progress."

2Identify the conflicting files

List all unmerged files to see exactly what needs to be resolved:

bash
git diff --name-only --diff-filter=U

This shows only files with unmerged (U) status. You can also use:

bash
git ls-files -u

to see the unmerged entries in the index.

3Resolve the conflicts manually

Open each conflicted file and look for conflict markers. The format is:

bash
<<<<<<< HEAD
Your current branch's version
=======
The incoming change (from cherry-pick)
>>>>>>> commit-hash

Edit the file to keep the code you want, removing all conflict markers. You can also use a merge tool:

bash
git mergetool

Or accept one side entirely:

bash
# Accept your version (current branch)
git checkout --ours <filename>

# Accept the incoming version (cherry-picked commit)
git checkout --theirs <filename>
4Stage the resolved files

After resolving conflicts in a file, mark it as resolved by staging it:

bash
git add <filename>

Or stage all resolved files at once:

bash
git add .

Verify that all conflicts are resolved:

bash
git status

The "Unmerged paths" section should be empty.

5Continue the cherry-pick operation

Once all conflicts are resolved and staged, continue the cherry-pick:

bash
git cherry-pick --continue

Git will open your editor for the commit message. Save and close to complete the operation.

6Alternative: Abort the cherry-pick entirely

If you want to cancel the cherry-pick and return to the state before it started:

bash
git cherry-pick --abort

This discards all conflict resolution work and restores your branch to its previous state. Your local uncommitted changes are preserved.

7Skip the problematic commit (use with caution)

If you're cherry-picking multiple commits and want to skip just this one:

bash
git cherry-pick --skip

This skips the current commit and moves to the next one in the sequence. Use this only if you're certain you don't need this particular commit's changes.

8Clean up stuck state (last resort)

If git cherry-pick --abort doesn't work, you can manually clear the cherry-pick state:

bash
# Remove the cherry-pick state files
rm .git/CHERRY_PICK_HEAD

# Reset to clean up the index
git reset --hard HEAD

Warning: git reset --hard will discard ALL uncommitted changes. Only use this as a last resort when other methods fail.

Advanced notes

Using merge strategies during cherry-pick: You can apply cherry-picks with specific merge strategies to handle conflicts automatically:

bash
# Favor the cherry-picked changes on conflict
git cherry-pick -X theirs <commit>

# Favor your current branch on conflict
git cherry-pick -X ours <commit>

Cherry-picking multiple commits: When cherry-picking a range of commits, conflicts are more likely. Process them from oldest to newest:

bash
git cherry-pick oldest_commit^..newest_commit

If conflicts occur, resolve each one and run git cherry-pick --continue to proceed.

Checking for in-progress operations: To see if any operation is pending:

bash
ls .git/CHERRY_PICK_HEAD .git/MERGE_HEAD .git/REBASE_HEAD 2>/dev/null

Best practice: Commit or stash your work-in-progress before starting a cherry-pick. This keeps your working directory clean and makes conflict resolution simpler.

Frequently asked questions

What does "error: Cherry-pick is not possible because you have unmerged files" mean?
This error indicates that Git is blocking a new cherry-pick operation because your repository is in the middle of resolving a previous conflict. When a merge, cherry-pick, or rebase encounters conflicts, Git pauses and waits for you to manually resolve those conflicts before continuing. The "unmerged files" mentioned in the error are files that contain conflict markers (<<<<<<, =======, >>>>>>) from a prior operation that hasn't been completed.
How do I fix "error: Cherry-pick is not possible because you have unmerged files"?
This error occurs when you attempt a cherry-pick while conflicts from a previous merge or cherry-pick remain unresolved. You must resolve or abort the pending operation before starting a new one.
What causes "error: Cherry-pick is not possible because you have unmerged files"?
A previous cherry-pick encountered conflicts and was not resolved or aborted A merge operation was started but conflicts were never committed Conflicts were partially resolved but not all files were staged with git add
Is the "error: Cherry-pick is not possible because you have unmerged files" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading