Common causes
- You edited files and didn't commit or stash before rebasing
- An editor or IDE auto-saved changes that show up as modifications
- Files were modified by a previous command and left uncommitted
- You're trying to rebase in the middle of other in-progress work
How to fix it
- Commit your work first: git add . && git commit -m 'WIP'
- Or stash and unstash: git stash, then git rebase <target>, then git stash pop
- Check what's modified: git status
- To discard changes if they don't matter: git checkout -- .
Example
error: cannot rebase: you have unstaged changes
error: Please commit or stash them.Running git rebase main with unsaved edits in the working tree
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
