Skip to content

Rebase Conflict Not Resolved

Error message

                error: could not apply <commit>... <message>
              

Quick summary

During a rebase, a commit could not be applied due to a conflict. You must resolve it, skip it, or abort.

Why this happens

  • The commit being replayed during rebase conflicts with the target branch

  • Both the rebase source and target changed the same lines

  • The rebase is replaying commits onto a significantly changed base

Minimal example

✗ Broken code
git rebase main  # error: could not apply abc123... Add feature
✓ Fixed code
# Option 1: resolve and continue
# Edit conflicted files to resolve
git add .
git rebase --continue

# Option 2: skip the commit
git rebase --skip

# Option 3: abort
git rebase --abort

Resolve conflicts and continue, skip the problematic commit, or abort to return to the original state.

How to diagnose

  • Run git status to see conflicted files

  • Open conflicted files and look for conflict markers

  • Run git rebase --show-current-patch to see the commit being applied

How to fix

  • Resolve conflicts in each file, git add them, then git rebase --continue

  • Skip the problematic commit: git rebase --skip

  • Abort the entire rebase: git rebase --abort (returns to pre-rebase state)

How to prevent

  • Keep feature branches short to minimize rebase conflicts

  • Rebase frequently onto the latest main to catch conflicts early

  • Communicate with your team about significant changes

Related Resources

Related Glossary

Related Lessons

← Back to language