Common causes
- A previous merge or pull left conflicts unresolved
- You ran git merge or git rebase and didn't finish resolving all conflicts
- Trying to switch branches in the middle of a conflicted merge
- Trying to stash while merge conflicts are present in the index
How to fix it
- Check which files still have conflicts: git status
- Open each conflicted file, resolve the markers, then: git add <file>
- Complete the merge after resolving all files: git commit
- To abort the entire merge and go back: git merge --abort
Example
error: you need to resolve your current index firstRunning git checkout or another command while in the middle of a conflicted merge
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
