Tag Archives: error: Your local changes to the following files would be overwritten by merge

[Solved] git pull Error: error: Your local changes to the following files would be overwritten by merge

The reason for this error is that you have modified the file locally and remotely at the same time

Solution:

Keep local files

git stash
git pull origin master
git stash pop

Do not keep the local file (restore the local file to the previous version and pull down the remote modification)

git reset --hard
git push origin master