How do I force an overwrite of local files on a git pull
?
The scenario is the following:
I believe there are two possible causes of conflict, which must be solved separately, and as far as I can tell none of the above answers deals with both:
Local files that are untracked need to be deleted, either manually (safer) or as suggested in other answers, by git clean -f -d
Local commits that are not on the remote branch need to be deleted as well. IMO the easiest way to achieve this is with: git reset --hard origin/master
(replace 'master' by whatever branch you are working on, and run a git fetch origin
first)