Skip to content

Resolve Your Current Index First

Error message

                error: you need to resolve your current index first
              

Quick summary

A previous merge or rebase left conflicts unresolved — you must resolve or abort before starting a new operation.

Why this happens

  • A merge conflict was not resolved before starting a new git operation

  • A rebase is paused on conflicts

  • A cherry-pick or revert hit conflicts and was not completed

Minimal example

✗ Broken code
git checkout main  # error: you need to resolve your current index first
✓ Fixed code
# Option 1: resolve and continue
git add .
git merge --continue

# Option 2: abort the merge
git merge --abort
git checkout main  # now succeeds

You must finish or abort the in-progress merge/rebase before running other git operations.

How to diagnose

  • Run git status to see the current state (merging, rebasing, etc.)

  • Check for conflicted files

  • Look for .git/MERGE_HEAD or .git/rebase-merge to confirm in-progress state

How to fix

  • Resolve all conflicts, git add each file, then git merge --continue or git rebase --continue

  • Abort the operation: git merge --abort, git rebase --abort, or git cherry-pick --abort

  • After aborting or completing, retry your original command

How to prevent

  • Always complete or abort a merge/rebase before starting new operations

  • Run git status to check for in-progress operations

Related Resources

Related Glossary

Related Lessons

← Back to language