Common causes
- You edited files locally but didn't commit or stash before pulling
- The same files were changed on the remote and locally
- You're trying to switch branches or merge with a dirty working tree
- An automated pull ran while you had unsaved work
How to fix it
- Commit your local changes first: git add . && git commit -m 'WIP'
- Or stash them temporarily: git stash, then git pull, then git stash pop
- To discard local changes entirely (data loss): git checkout -- <file>
- Review what's modified before deciding: git status && git diff
Example
error: Your local changes to the following files would be overwritten by merge:
src/App.js
Please commit your changes or stash them before you merge.Running git pull with uncommitted changes to files that the remote also modified
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
