The 'cherry-pick is now empty' error occurs when Git detects that the commit you're trying to cherry-pick would result in no changes. This happens when the changes already exist in your branch or when conflict resolution removed all modifications.
When you attempt to cherry-pick a commit in Git, you're asking Git to apply the changes from that specific commit onto your current branch. The "cherry-pick is now empty, possibly due to conflict resolution" message appears when Git determines that applying this commit would result in no actual changes to your working tree. This situation arises in several scenarios. Most commonly, the changes you're trying to cherry-pick already exist in your current branch's history - perhaps they were merged through a different path, applied via a previous cherry-pick, or included as part of a larger merge. Git recognizes that applying these changes again would be redundant. The phrase "possibly due to conflict resolution" refers to another common scenario: during the cherry-pick process, if conflicts occurred and you resolved them by discarding all the incoming changes (perhaps by accepting "ours" for every conflict), you end up with a commit that introduces no modifications. Git warns you about this because it might indicate an unintended resolution - you may have accidentally removed all the changes you intended to apply.
Before taking action, examine what caused the empty cherry-pick. Check if the changes already exist in your branch:
# View the content of the commit you're trying to cherry-pick
git show <commit-hash>
# Compare with your current branch to see if changes already exist
git log --oneline --all --grep="<part of commit message>"
# Check the diff between branches
git diff HEAD..<commit-hash>If the diff is empty or minimal, the changes likely already exist in your branch.
If you don't need to preserve the empty commit (the most common choice), skip it and continue with the rest of the cherry-pick sequence:
# Skip this commit and continue with remaining commits
git cherry-pick --skipThis abandons the current empty commit and moves to the next commit in the sequence (if you're cherry-picking multiple commits). This is the recommended approach when the changes are truly redundant.
If you need to preserve the commit for historical tracking (e.g., to maintain a 1:1 correspondence with another branch), create the empty commit:
# Commit the empty cherry-pick
git commit --allow-empty
# This opens your editor - you can modify the commit message
# or keep the default cherry-pick messageThis is useful in scenarios where you're mirroring commits between branches and need to maintain matching commit history.
If you started the cherry-pick by mistake or want to reconsider your approach:
# Abort the entire cherry-pick operation
git cherry-pick --abortThis returns your repository to the state before you began the cherry-pick. Any resolved conflicts or staged changes from the cherry-pick will be discarded.
Modern Git versions support the --empty flag to handle empty commits automatically during cherry-pick:
# Drop commits that become empty (skip them automatically)
git cherry-pick --empty=drop <commit-range>
# Keep commits that become empty (creates empty commits)
git cherry-pick --empty=keep <commit-range>
# Stop on empty commits for manual decision (default behavior)
git cherry-pick --empty=stop <commit-range>Using --empty=drop is particularly useful when cherry-picking a range of commits where some may already exist in your branch.
If you suspect your conflict resolution accidentally removed all changes, reset and try again:
# Reset the current cherry-pick state
git reset
# Continue cherry-pick from where it left off
git cherry-pick --continue
# Or abort and restart with the original commit
git cherry-pick --abort
git cherry-pick <original-commit-hash>During conflict resolution, be careful to preserve the changes you actually want. Use git diff --staged to review what you're about to commit.
Before cherry-picking, verify the commit isn't already in your history:
# Check if commit is an ancestor of your current branch
git merge-base --is-ancestor <commit-hash> HEAD && echo "Already in history"
# Find commits with similar changes
git log --oneline --all --source -- <file-changed-in-commit>
# View the cherry-pick status
git statusIf the commit is already in your history through a different path, cherry-picking it will result in an empty commit.
### When Empty Commits Are Intentional
Some workflows intentionally create empty commits as markers or for CI/CD triggers. Git's --allow-empty flag exists specifically for this purpose. When cherry-picking, you might encounter commits that were originally created empty.
### Cherry-Picking After Reverts
A common source of empty cherry-picks is when dealing with reverted commits. If branch A has commits: Add feature -> Revert "Add feature", and you try to cherry-pick Revert "Add feature" onto branch B that never had the feature, you'll get an empty commit because there's nothing to revert.
### The Difference Between --skip and --continue
- git cherry-pick --skip abandons the current commit entirely and moves to the next one
- git cherry-pick --continue attempts to complete the current commit (requires staged changes or --allow-empty)
### Using git cherry-pick with Ranges
When cherry-picking ranges (git cherry-pick A..B or git cherry-pick A^..B), empty commits in the range can interrupt the process. Use --empty=drop to automatically skip these:
git cherry-pick --empty=drop feature-branch~5..feature-branch### Sequencer State Files
Git stores cherry-pick progress in .git/sequencer/. If you encounter issues, you can inspect these files to understand the state, or remove them manually (as a last resort) with rm -rf .git/sequencer followed by git cherry-pick --abort.
warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server