Skip to content

git cherry-pick: commit is empty

Quick summary

You cherry-picked a commit whose changes are already present in the current branch — git reports the commit is empty or a no-op.

Why this happens

  • The commit was already cherry-picked or merged into this branch, so applying it again changes nothing

  • The changes in the picked commit were manually replicated in the target branch before the cherry-pick

  • You are cherry-picking from a branch that is already an ancestor of the current branch

Minimal example

✗ Broken code
git cherry-pick abc123  # error: commit abc123 is empty (already applied)
✓ Fixed code
git cherry-pick --skip  # skips the empty pick and continues
git cherry-pick --abort  # cancels entirely if not needed

The --skip option lets you move past an already-applied commit in a cherry-pick sequence without leaving the repo in a conflicted state.

How to diagnose

  • Run git log --oneline to check if the commit or its changes already appear in the current branch history

  • Use git cherry <target> <source> to see which commits are already applied and which are not

  • Run git diff after the cherry-pick to confirm the working tree has no changes from the pick

How to fix

  • Skip the empty commit with git cherry-pick --skip to continue the cherry-pick sequence

  • Abort the cherry-pick with git cherry-pick --abort if the commit is not needed in this branch

  • Force the empty commit with --allow-empty if you need the commit metadata for audit trail purposes

How to prevent

  • Check git cherry before cherry-picking to see if the commit is already applied to the target branch

  • Track cherry-picked commits in a log or label to avoid duplicating picks across branches

Related Resources

Related Glossary

Related Lessons

← Back to language