Explore Courses Blog Tutorials Interview Questions
+5 votes
in DevOps and Agile by (19.4k points)
edited by

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.

1 Answer

+6 votes
by (27.5k points)
edited by

Here are two solutions: 

$ git checkout HEAD^ file/to/overwrite

$ git pull

For more commands like this please go through the following tutorial that will help you understand the git


Browse Categories