1

In other solutions for GIT error: "The following untracked working tree files would be overwritten by merge" -- many solutions involve git stash and then git stash pop, but how would I just overwrite my local changes with the git pull I'm doing. How would that be done?

I don't care for my local changes if it gets overwritten. I have many files that are not in conflict to this error, so I can't just remove these files via git clean neither.

Patoshi パトシ
  • 21,707
  • 5
  • 29
  • 47
  • 3
    Possible duplicate of [How do I force "git pull" to overwrite local files?](https://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files) – JoshuaRLi Oct 14 '17 at 03:43

1 Answers1

0

This was the error for me:

error: The following untracked working tree files would be overwritten by merge:
    img/theme/button.png
Please move or remove them before you merge.
Aborting

I just did what the message says: "Please move or remove them before you merge."

I removed button.png and then tried git pull ... again. This time everything worked correctly and without problems. What was happening in my case is that my git pull ... included a commit that had this img/theme/button.png image. Then the image already existed and it would be overwritten. As a result of that, I was getting that error message. But it was fixed for me as I mentioned by removing the file and then pulling again.

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103