I have a few commits with several files in my local repository (not pushed yet). When I am doing a git pull in (EGit) it is showing many incoming changes and one file in conflict. I just want to replace this file with incoming changes but do not want other changes in my commits to be replaced. Just a single conflicting file replace. I tried git checkout --theirs filename
from git bash followed by git pull
resulting in the following message- Automatic merge failed; fix conflicts and then commit the result
which is clear but I want to overwrite that conflict with latest one. How can I resolve this?
I don't know is this can be done without a rebase. A similar situation is described here but that involves a rebase, which I want to avoid.