Overwriting my local changes in response to GIT error: “The following untracked working tree files would be overwritten by merge”

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Overwriting my local changes in response to GIT error: “The following untracked working tree files would be overwritten by merge”



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.





Possible duplicate of How do I force "git pull" to overwrite local files?
– JoshuaRLi
Oct 14 '17 at 3:43




1 Answer
1



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."


"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.


button.png


git pull ...


git pull ...


img/theme/button.png






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS