user1132363 user1132363 - 6 months ago 36
Git Question

How to ignore error on git pull about my local changes would be overwritten by merge?

How do I ignore the following error message on git pull?

Your local changes to the following files would be overwritten by merge

What if I want to overwrite them?

I've tried things like
git pull -f
, but nothing works.

To be clear, I only want to overwrite specific changes, not everything.


Alright with the help of the other two answers I've come up with a direct solution:

git checkout HEAD^ file/to/overwrite
git pull