글

라벨이 git stash인 게시물 표시

error: Your local changes would be overwritten by merge - 10 Causes and Fixes

이미지
You ran git pull (or git merge ) and Git refused with error: Your local changes would be overwritten by merge , followed by a list of files and the hint Please commit your changes or stash them before you merge . Nothing was merged, nothing was lost — Git stopped before touching your working tree because the incoming commits modify files you have already edited but not committed. This is a pre-flight check , not a merge conflict. A merge conflict happens during a merge and leaves conflict markers in your files. This error happens before the merge starts, and your repository is left exactly as it was. The fix depends on one question: do you want to keep your local edits? This page covers both answers, plus the less obvious cases — file mode changes, line-ending normalization, git stash failing on the same files, submodules, and CI checkouts that hit this on a clean-looking machine. Error error: Your local changes to the following files would be overwritten by merge: src...